Re: How to make a program look for dylibs other than /usr/local/lib?
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: Graham Reitz <email@hidden>
- Date: Thu, 6 Dec 2007 17:14:45 -0600
Thanks Peter that definitely has me in the right direction.
Ok I can see the problem using otool -L
The executable is still looking in the /usr/local/lib for the
libmysqlpp.2.dylib file. I changed the Runpath Search Paths variable
(-rpath) to a directory with the location of the libmysqlpp.2.dylib
file(s) but it's not changing where the executable is looking for the
dylib. Is there a way to change that at compile/link time?
otool -L tac
tac:
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version
1.2.3)
/sw/lib/mysql/libmysqlclient_r.15.dylib (compatibility version
16.0.0, current version 16.0.0)
/usr/local/lib/libmysqlpp.2.dylib (compatibility version 0.0.0,
current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.0.0)
I am somewhat surprised that the executable doesn't look for dylibs in
the current directory.
thanks again,
graham
On Dec 6, 2007, at 12:08 AM, Peter O'Gorman wrote:
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
_______________________________________________
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