• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode project setup for GLFW library reference problem.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode project setup for GLFW library reference problem.


  • Subject: Re: Xcode project setup for GLFW library reference problem.
  • From: "Jeremy W. Sherman" <email@hidden>
  • Date: Wed, 22 Apr 2009 22:42:47 -0400

I believe @executable_path is the path to the currently running executable (think `dirname "$0"`). If your dylib is not sitting right next to your executable in the same folder, dyld is not going to find it where it expects it. The library search path setting affects your compile and link-time search path, not your runtime search path.

Try adding a copy files build phase to plunk the dylib at @executable_path and then try running your executable again.

Also, you might want to investigate using the bundle layout for your app. See the Bundle Programming Guide (http://developer.apple.com/DOCUMENTATION/CoreFoundation/Conceptual/CFBundles/CFBundles.html).

—Jeremy

On Wed, Apr 22, 2009 at 9:20 AM, Adam Taylor <email@hidden> wrote:

Hi All,

I'm working on an assignment which is to simulate the beginning of the universe using C and OpenGL/GLFW.

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".

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:

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

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.

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.

I checked that the library was executable and it is, do I need to set that library path somewhere else?

Thanks in advance.

Adam

--
email@hidden
http://www.twitter.com/adamtaylor

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Xcode project setup for GLFW library reference problem. (From: Adam Taylor <email@hidden>)

  • Prev by Date: Can't change the Active SDK back to iphone 2.0 stuck on 3.0
  • Next by Date: Re: Looking for NSLog help
  • Previous by thread: Xcode project setup for GLFW library reference problem.
  • Next by thread: Code Signing and Replacement Certificates?
  • Index(es):
    • Date
    • Thread