• 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: OS X Shared Libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS X Shared Libraries


  • Subject: Re: OS X Shared Libraries
  • From: "Simon J. Bale" <email@hidden>
  • Date: Mon, 14 Jan 2008 11:12:38 +0000

Can I confirm that I'm correct in assuming that the library paths are usually hard coded into Mach-O binaries?

On 14 Jan 2008, at 10:18, Sebastian Hagedorn wrote:

--On 14. Januar 2008 10:00:31 +0000 email@hidden wrote:

I'm fairly new to OS X and I have a basic question regarding shared
library handling. I notice that when I run otool -L on a binary that the
full path of any shared libraries is returned. Is the full path directly
encoded into the executable? Does OS X have a system similar to Linux
where the runtime linker searches several system paths for the required
libraries? If i compile an application that generates its own libraries
and then links it's executable against these libraries the hard coded
path will point to the build directory. Obviously this would cause a
problem when the binaries and shared libraries are installed into the
system path, how is this typically avoided?

By using relative paths, e.g.:

OmniWeb:
@executable_path/../Frameworks/OWF.framework/Versions/A/OWF (compatibility version 1.0.0, current version 1.0.0)


You can also change the paths afterwards by using /usr/bin/ install_name_tool.
--
.:.Sebastian Hagedorn - RZKR-R1 (Gebäude 52), Zimmer 18.:.
Zentrum für angewandte Informatik - Universitätsweiter Service RRZK
.:.Universität zu Köln / Cologne University - ✆ +49-221-478-5587.:.
.:.:.:.Skype: shagedorn.:.:.:.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: OS X Shared Libraries
      • From: Peter O'Gorman <email@hidden>
References: 
 >OS X Shared Libraries (From: email@hidden)
 >Re: OS X Shared Libraries (From: Sebastian Hagedorn <email@hidden>)

  • Prev by Date: Re: OS X Shared Libraries
  • Next by Date: Re: OS X Shared Libraries
  • Previous by thread: Re: OS X Shared Libraries
  • Next by thread: Re: OS X Shared Libraries
  • Index(es):
    • Date
    • Thread