• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Linking Tool to nested dylib: "Library not loaded…"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Linking Tool to nested dylib: "Library not loaded…" (From: Jerry Krinock <email@hidden>)
 >Re: Linking Tool to nested dylib: "Library not loaded…" (From: Fritz Anderson <email@hidden>)
 >Re: Linking Tool to nested dylib: "Library not loaded…" (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Linking Tool to nested dylib: "Library not loaded…"
  • Next by Date: Re: Xcode 4.2 Debugging problem.
  • Previous by thread: Re: Linking Tool to nested dylib: "Library not loaded…"
  • Next by thread: Xcode 4.2 super slow documentation searching
  • Index(es):
    • Date
    • Thread