• 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: How to make a program look for dylibs other than /usr/local/lib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a program look for dylibs other than /usr/local/lib?


  • Subject: Re: How to make a program look for dylibs other than /usr/local/lib?
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 11 Dec 2007 14:06:31 +0000

On 11 Dec 2007, at 14:01, parag vibhute wrote:

On Dec 11, 2007 7:06 PM, Alastair Houghton <email@hidden > wrote:
On 11 Dec 2007, at 13:30, parag vibhute wrote:

> 2. The problem you're trying to solve.
>
> The same problem i.e. do not want to change environment variables &
> also want to place dependant dynamic library at non standard location.


You need to use install_name_tool.  The -dylib_file option tells the
linker (not the dynamic linker) where to find a dylib.  It's used if
you are trying to link against something that hasn't already been
copied to its final location.  The final image will still contain the
path that was hard-coded into the dylib.

Not understood ur statement "It's used if you are trying to link against something that hasn't already been copied to its final location." Can u please eloborate it in detail? Is it same as Library search path?


It's not what you want.

It's only used if you're trying to do a build and the static linker can't find a dependent library. For instance, say you have a dylib "liba.dylib", and a dylib "libb.dylib", and say that "liba.dylib" links to "libb.dylib", and that your program only links to "liba.dylib".

When it's linking your program, the linker looks in "liba.dylib" and finds the install name of "libb.dylib" listed as a library that "liba.dylib" links against. If you haven't yet installed "libb.dylib" in its final location, the linker will try to open it and fail, because it isn't where the install name says it should be. The - dylib_file option is a way around that problem.

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________ 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
  • Follow-Ups:
    • Re: How to make a program look for dylibs other than /usr/local/lib?
      • From: "parag vibhute" <email@hidden>
References: 
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Alastair Houghton <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Alastair Houghton <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Alastair Houghton <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Alastair Houghton <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)

  • Prev by Date: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Next by Date: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Previous by thread: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Next by thread: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Index(es):
    • Date
    • Thread