M1 Mac Xcode cannot see 'glew' other libraries installed with Homebrew

I am trying to run a computer graphics code which uses "glew", "OpenGL", "Glut" frameworks. My M1 Mac cannot see "glew" which I have downloaded using homebrew.

I dragged and dropped the libGLEW2.2.0.dylib under opt/homebrew/Cellar/lib... into the "Link with libraries" part of the Build Phases of my Xcode project.

I am getting the following error

dyld[23765]: Library not loaded: /opt/homebrew/opt/glew/lib/libGLEW.2.2.dylib

Can you please help me with this? the library is already loaded but Xcode cannot see it under the directories that it checks.

In your Xcode target, do you have the hardened runtime enabled? If so, try (just for diagnostic purposes) disabling it. You can do this by removing that capability from the Signing & Capabilities editor.

The hardened runtime enables library validation. Library validation ensures that the process running this executable only loads platfrom code (that stuff built-in to the OS) or code signed by your team. Package manages generally produce ad hoc signed code, which is incompatible with library validation.

If the diagnostic test above works, we can talk about how you should fix this in the long term.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Were you able to solve this?

I use this command ln -sf /opt/homebrew/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.dylib /usr/local/lib/libGLEW.2.2.dylib, and build glew from source.

M1 Mac Xcode cannot see 'glew' other libraries installed with Homebrew
 
 
Q