Re: Can I drag-install dylibs?
Re: Can I drag-install dylibs?
- Subject: Re: Can I drag-install dylibs?
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 16 Dec 2003 16:20:34 -0800
On Dec 16, 2003, at 11:13 AM, jason rusoff wrote:
Yes, I linked against the files in my app. I also added a copy files
phase and tried putting the dylibs into myapp.app/Contents/MacOS/ and
in myapp.app/Contents/Frameworks.
Still no go. Do I need to check if the libs are built with GCC 2.9
versus 3.1? I'm using 3.1, but the libs are old and may have used GCC
2.9.5
Here is what I see on launch:
dyld:
/Users/jasonrus/Projects/scan/FieryRemoteScanX/Mac/build/
HarmonyTests.app/Contents/MacOS/HarmonyTests can't open library:
libtrpc_osa.dylib (No such file or directory, errno = 2)
It appears that you've run into a "feature" of the Mach-O ABI: Shared
libraries have installation paths, and when an executable is linked
against a shared library, the executable fully expects the library to
be in the exact place specified by the installation path.
So if you have access to the source of the libraries, then you need to
rebuild them with installation paths specified. "@executable_path" is a
macro that points to the executable's path, so if you want to place
libSomething.dylib in the executable's Frameworks directory, for
example, you'd use "@executable_path/../Frameworks/libSomething.dylib".
If you don't have access to the source, then this becomes more
interesting... You'll have to use the command line program
"install_name_tool" and hope you get lucky.
As for GCC, if the executable and libraries use even a little C++, then
they must be compiled with the same compiler. If they use C or
Objective-C instead, then they don't need to be the same.
Nick Zitzmann
<
http://seiryu.home.comcast.net/>
S/MIME signature available upon request
"That's a funny thing to promise. Well, you can't never let anything
happen to him [Nemo]; then, nothing would ever happen to him." - Dory,
from the movie "Finding Nemo"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.