Re: troubles with including an .so file
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 10:35:02 -0800
On Nov 15, 2007, at 9:47 AM, email@hidden wrote:
Please indulge my lack of understanding, but I don't quite know how to
actually set that very "library install path"... How can I tell XCode
at compile time where the library will be after compiling? I looked at
and tried out many things in the Inspector of the Target (Application)
but couldn't get it working yet...
Your help is greatly appreciated! thanks!
raphael
Zitat von Rick Altherr <email@hidden>:
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
In the target's build settings, there is a setting called
"Installation Directory". That gets prefixed to the "Product Name"
setting.
--
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