title: Xcode project setup for GLFW library
body: <p>I'm working on an assignment which is to simulate the beginning of the universe using C and OpenGL/GLFW.</p>
  
  <p>I'm pretty new to C and also to Xcode, which is not helping at all.  I've overcome my silly compilation problems and the code is finding GL/glfw.h ok.  When I compile and run I receive a "Visualisation [name of the project] has exited with status 5".  </p>
  
  <p>I wasn't really sure what that meant but if I try and run the code from the command line I get the following error:</p>
  
  <pre><code>ADAM:Debug adam$ ./Visualisation 
  dyld: Library not loaded: @executable_path/libglfw.dylib
  Referenced from: /Users/adam/Documents/Programming/C/Visualisation/build/Debug/./Visualisation
  Reason: image not found
  Trace/BPT trap
  </code></pre>
  
  <p>I added libglfw.dylib to the project the same way I added libglfw.a to see if that fixed it and no, it didn't.</p>
  
  <p>I can't figure out where @executable_path is set or what it is set to but inside the build settings for the project in Library Search Paths is "$(SRCROOT)/../../../../glfw/lib/macosx" which is where this library resides.  </p>
  
  <p>I checked that the library was executable and it is, do I need to set that library path somewhere else?</p>