Trying to setup Xcode with OpenGL

Viewed 549

I've been trying to setup Xcode with OpenGL, but I can't get it to work.

I have been getting this error every time:

dyld: Library not loaded: /usr/local/opt/glfw/lib/libglfw.3.dylib
  Referenced from: /Users/parisjackson-newman/Library/Developer/Xcode/DerivedData/GLFW_OpenGL-fjibdenxheioomgsseembfpbmeih/Build/Products/Debug/GLFW OpenGL
  Reason: no suitable image found.  Did find:
    /usr/local/opt/glfw/lib/libglfw.3.dylib: code signature in (/usr/local/opt/glfw/lib/libglfw.3.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/lib/libglfw.3.dylib: code signature in (/usr/local/lib/libglfw.3.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/Cellar/glfw/3.3.2/lib/libglfw.3.3.dylib: code signature in (/usr/local/Cellar/glfw/3.3.2/lib/libglfw.3.3.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
(lldb) 

I used home-brew to install glfw and glew. And the code I am running is the standard window code from the glfw.org website

2 Answers

Go to your Project Navigator and select your project.

Then, go to the Hardened Runtime section under the Signing & Capabilities tab.

Click the checkbox for Disable Library Validation.

Once this is done, you should be able to run your project.

enter image description here

Seems root issue

  1. install glfw from a package manager like brew brew install glfw

  2. xcode search headers path usr/local/include

  3. xcode search libraries path usr/local/lib

Related