I am setting up GLFW in Xcode for the first time and I am stuggling with getting everything set up correctly. I’ve included AGL, Carbon, and OpenGL frameworks; as well as libglfw.a… I’ve set the library search paths to the glfw/lib/macosx folder, but I am getting the following error when compiling a tutorial lesson:
[Session started at 2007-05-20 08:02:29 -0400.]
dyld: Library not loaded: @executable_path/libglfw.dylib
Referenced from: /Users/pjstudio/secondtry/build/Release/XcodeGLFW.app/Contents/MacOS/XcodeGLFW
Reason: image not found
XcodeGLFW has exited due to signal 5 (SIGTRAP).
I am not sure what the issue is at this point, as search for this error online has not revealed much.
Could someone point me in the right direction!
Thank you!
It can be fixed by copying the libglfw.dylib into your .app/Contents/MacOSX/ folder. It will be removed if you do a clean build. Dont know how to make XCode do this automatically.
You’re linking against the dynamic version of the GLFW library. If possible, use the installation make target of GLFW, i.e.
$ sudo make macosx-install
as detailed in the redame.html file. This will put the static library (but not the dynamic one) and the header file in places where GCC will automatically find them. Then you can remove the explicit search paths to your local copy of the GLFW source tree.