Re: Having trouble with -dylib_file
Re: Having trouble with -dylib_file
- Subject: Re: Having trouble with -dylib_file
- From: Jonas Maebe <email@hidden>
- Date: Tue, 6 Jan 2009 22:12:56 +0100
On 06 Jan 2009, at 22:02, Jeff Schriebman wrote:
Thanks for the information.
I tried your solution number 2 but without rebuilding the library.
Instead I simply copied the existing library into my application
bundle and invoked install_name_tool -change as you suggested.
Using this approach my application now finds the libpng.3.dylib that
is in the application bundle but the loader is still not finding
what it needs.
The following is the loader failure message that appears on 10.4
dyld: Library not loaded: @executable_path/../Frameworks/libpng.
3.dylib
Referenced from: /Users/jeff/Desktop/MyApp.app/Contents/MacOS/MyApp
Reason: no suitable image found. Did find:
/Users/jeff/Desktop/MyApp.app/Contents/MacOS/../Frameworks/libpng.
3.dylib: can't map
/Users/jeff/Desktop/MyApp.app/Contents/MacOS/../Frameworks/libpng.
3.dylib: can't map
Did you also change the install name of the library itself (by running
install_name_tool on the library)? It must match its install location.
The reasoning, as far as I understand, is basically that you can put
your dynamic libraries anywhere on your system during development.
During the (static) linking stage of your application, the install
name of each linked library is copied into your application, so that
at run time the application will know where to look for them (which
may be in a completely different place than where they were located
during building).
I suppose the dynamic linker checks the install name of linked dynamic
libraries at program startup time to avoid accidentally loading the
wrong library.
Jonas
_______________________________________________
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