Re: Dynamic library search path
Re: Dynamic library search path
- Subject: Re: Dynamic library search path
- From: "Peter O'Gorman" <email@hidden>
- Date: Thu, 22 Dec 2005 19:36:07 +0000
On Dec 22, 2005, at 6:53 PM, Vlad Alexander (XStandard) wrote:
If we add a dynamic library like libxml2.dylib into our Web browser
plug-in bundle, how do we know that our software will be using the
dynamic library in our bundle rather than the version installed in
the OS or the version installed in the parent application bundle?
In other words, what is the search sequence the OS uses to find
dynamic libraries?
Use otool -D to figure out the install_name of the libxml2.dylib that
you add to the project. Ensure that it is a full path to where you
will install it. Then, use otool -L to check the plug-in bundle has
the same install_name listed in the list of dependent libraries.
I would actually suggest giving the libxml2.dylib you intend to use a
uniqe basename, e.g. /full/path/to/install/location/
liborg_company_product_libxml2.dylib to make your life easier, make
sure that this basename is the the same as the one you see with otool
-D and otool -L.
The dynamic linker, dyld, should look for libraries in paths
specified in the DYLD_LIBRARY_PATH environment variable first, then
in the path specified by the full install_name, then in the paths
specified by the DYLD_FALLBACK_LIBRARY_PATH environment variable (or
the defaults of $(HOME)/lib:/usr/local/lib:/lib:/usr/lib if the env
var is unset).
See the manpages for dyld(1) ld(1), otool(1) and the documentation on
developer.apple.com for more info.
Peter
_______________________________________________
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