• 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: troubles with including an .so file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: troubles with including an .so file


  • Subject: Re: troubles with including an .so file
  • From: Rick Altherr <email@hidden>
  • Date: Thu, 15 Nov 2007 08:50:02 -0800


On Nov 15, 2007, at 12:15 AM, Raphaël Jecker wrote:

Hi there

after having tried out everything I could find on this Subject I hope to finally get help here:
The problem looks as follows: I can compile the project, but when I try to run the Application I get an error like this:
dyld: Library not loaded: libSurf.so
Reason: image not found
I am quite new to programming on XCode I must say. The only way I get it working is to open a Terminal, set the Environment Variable with
export DYLD_LIBRARY_PATH= (mypath)
and run the App from inside the terminal - which I don't find a very nice thing to do everytime. I tried the dylib_file flag as well but didn't work either.
Anyone know how to get that right?


Thanks alot in advance!
raphael


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


This email sent to email@hidden


When linking against a dynamic library, ld inserts the library's install path into the binary linking against it. If in this case, your libSurf.so has an install path of "libSurf.so", then when your executable is linked, it will have a reference to "libSurf.so". The search order for a dynamic library by dyld is: DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH, install path, DYLD_FALLBACK_FRAMEWORK_PATH, and then DYLD_FALLBACK_LIBRARY_PATH. Since DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH are typically blank, dyld looks for the library at its install path. In your case, that means looking for libSurf.so in the current directory. Then, if it doesn't find it, it looks in / Library/Frameworks:/Network/Library/Frameworks:/System/Library/ Frameworks which is the default for DYLD_FALLBACK_FRAMEWORK_PATH, then it moves to $(HOME)/lib:/usr/local/lib:/lib:/usr/lib which is the default for DYLD_LIBRARY_PATH.

So, the moral of the story: your library's install path is wrong. Fix that and the rest should be automatic.
--
Rick Altherr
Architecture and Performance Group
email@hidden



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >troubles with including an .so file (From: Raphaël Jecker <email@hidden>)

  • Prev by Date: Re: SVN: how to specify a path different from the project path to use for svn calls
  • Next by Date: Need help - internal link edit command failed - undefined symbol ) _DisposePtr, _NewPtr
  • Previous by thread: troubles with including an .so file
  • Next by thread: Re: troubles with including an .so file
  • Index(es):
    • Date
    • Thread