Skip navigation.
 
mlRe: How to make a program look for dylibs other than /usr/local/lib?
FROM : Peter O'Gorman
DATE : Thu Dec 06 07:08:21 2007

Graham Reitz wrote:
> I have a C++ project that needs to load a third party dylib.  I removed
> the dylib from /usr/local/lib and placed it in a different directory.  I
> updated the linker paths to reflect this change .  When I run the
> program it is still looking for the dylib in /usr/local/lib.
>
> How do you tell it to look for the dylib in a different directory?
>
>  It still looks in /usr/local/lib even if I place the dylib in the same
> directory as the binary.


Look at the manpage for install_name_tool, also google for docs for
@executable_path, @loader_path and @rpath.

Even though you have moved the binary, its install_name remains as
/usr/local/lib/libfoo.dylib.

Peter
--
Peter O'Gorman
http://pogma.com

Related mailsAuthorDate
mlHow to make a program look for dylibs other than /usr/local/lib? Graham Reitz Dec 6, 06:58
mlRe: How to make a program look for dylibs other than /usr/local/lib? Peter O'Gorman Dec 6, 07:08
mlRe: How to make a program look for dylibs other than /usr/local/lib? Graham Reitz Dec 7, 00:14
mlRe: How to make a program look for dylibs other than /usr/local/lib? Peter O'Gorman Dec 7, 09:03
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 7, 16:39
mlRe: How to make a program look for dylibs other than /usr/local/lib? Peter O'Gorman Dec 7, 17:21
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 8, 18:06
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 8, 18:44
mlRe: How to make a program look for dylibs other than /usr/local/lib? Greg Guerin Dec 8, 19:41
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 10, 08:44
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 10, 15:41
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 10, 16:35
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 10, 16:43
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 10, 16:51
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 10, 16:55
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 10, 17:01
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 10, 17:16
mlRe: How to make a program look for dylibs other than /usr/local/lib? Greg Guerin Dec 10, 20:27
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 11:32
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 11, 12:14
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 12:46
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 11, 13:53
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 14:05
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 11, 14:30
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 14:36
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 11, 15:01
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 15:06
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 11, 15:16
mlRe: How to make a program look for dylibs other than /usr/local/lib? Nick Zitzmann Dec 11, 18:07
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 11, 18:11
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 12, 08:32
mlRe: How to make a program look for dylibs other than /usr/local/lib? Greg Guerin Dec 12, 18:47
mlRe: How to make a program look for dylibs other than /usr/local/lib? Alastair Houghton Dec 12, 18:54
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 13, 08:25
mlRe: How to make a program look for dylibs other than /usr/local/lib? parag vibhute Dec 14, 08:49