RE: Linking Tool to nested dylib: "Library not loaded…"
RE: Linking Tool to nested dylib: "Library not loaded…"
- Subject: RE: Linking Tool to nested dylib: "Library not loaded…"
- From: "Dallman, John" <email@hidden>
- Date: Mon, 24 Oct 2011 17:42:12 +0000
- Thread-topic: Linking Tool to nested dylib: "Library not loaded…"
> I call @executable_path "magic" because I've never understood how a
> library can tell the executable where it is located, so that the
> executable can locate said library.
At link time, the "install name" of the dylib, which is embedded within
the dylib, is copied and embedded within the executable.
You can look at these paths with "otool -L", and change them with
"install_name_tool -id" applied to the dylib, or "install_name_tool
-change" applied to the executable.
The product I produce comes as dylibs that doesn't have a canonical
position in the filesystem, because multiple apps have to be able to
have separate copies of them. So I got to learn all about this. If
you need to do the same, it's important to link the dylib with the
"-headerpad_max_install_names" option, so that there is spare space
in the header for the install name to get longer.
--
John Dallman
_______________________________________________
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