nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.58k stars 609 forks source link

dyld[23765]: Library not loaded: /opt/homebrew/opt/glew/lib #360

Open maheshmnj opened 2 years ago

maheshmnj commented 2 years ago

I am trying to import glew in my opengl project, The build succeeds but there is a run time error

dyld[1206]: Library not loaded: /opt/homebrew/opt/glew/lib/libGLEW.2.2.dylib
Referenced from: /Users/mahesh/Library/Developer/Xcode/DerivedData/shaders_tutorial-dmpbkihfzacdojeludtugemxgahg/Build/Products/Debug/shaders_tutorial
 Reason: tried: '/Users/mahesh/Library/Developer/Xcode/DerivedData/shaders_tutorial-dmpbkihfzacdojeludtugemxgahg/Build/Products/Debug/libGLEW.2.2.dylib' (no such file), 
'/usr/lib/system/introspection/libGLEW.2.2.dylib' (no such file), '/opt/homebrew/opt/glew/lib/libGLEW.2.2.dylib' (code signature in
 <5B17918D-3F6B-34E1-AB68-489FA9ECB892> '/opt/homebrew/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib' not valid for use in
 process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)),
 '/usr/local/lib/libGLEW.2.2.dylib' (no such file), '/usr/lib/libGLEW.2.2.dylib' (no such file),
 '/Users/mahesh/Library/Developer/Xcode/DerivedData/shaders_tutorial-dmpbkihfzacdojeludtugemxgahg/Build/Products/Debug/libGLEW.2.2.0.dylib' (no such file),
'/usr/lib/system/introspection/libGLEW.2.2.0.dylib' (no such file), '/opt/homebrew/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib' (code signature in <5B17918D-3F6B-34E1-AB68-489FA9ECB892> '/opt/homebrew/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib' not valid
 for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), 
'/usr/local/lib/libGLEW.2.2.0.dylib' (no such file), '/usr/lib/libGLEW.2.2.0.dylib' (no such file)
(lldb) 

I have linked the following binaries in Xcode

image

I have also included the GL libraries in my incliude folder which is added to headers search Path in xcode

image

I am using a m1 mac,

Let me know if you need any further info

nigels-com commented 2 years ago

Appears to be a Mac security feature? https://developer.apple.com/forums/thread/695481

-- Nigel

maheshmnj commented 2 years ago

thanks for your response @nigels-com. Is there a way to deal with this issue?

nigels-com commented 2 years ago

Might be worth updating your homebrew install. https://github.com/Homebrew/brew/issues/9082

eccentric13 commented 2 years ago

I have the same issue in Xcode configured Opencv 4.5.5_2.

maheshmnj commented 2 years ago

Unfortunately, upgrading homebrew did not make a difference and the issue persists.

nigels-com commented 2 years ago

There is some troubleshooting information on the Homebrew discussions: https://github.com/Homebrew/discussions/discussions/3124

I'm not able to reproduce this, my Mac is not as recent.