In article <sl*******************@nospam.invalid>,
Antoninus Twink <no****@nospam.invalidwrote:
>On 10 Apr 2008 at 21:11, Visa Inquirer wrote:
>I need my program to always link to a particular shared library, not
the one in LD_LIBRARY_PATH.
Is there a way to specify shared library by full path when linking so
that when running LD_LIBRARY_PATH is ignored?
>You can set the program's rpath: this will hard code a dynamic library
search path into your binary, and on most systems this will override
LD_LIBRARY_PATH.
Most systems? I dunno about that. Certainly not on the system I'm
using now -- here the -rpath ld option *adds* the given directory
to the search path, but does not override LD_LIBRARY_PATH (or the
system variations therein such as LD_LIBRARY64_PATH). On the system
I'm using, you have to link with -no_library_replace to prevent
the path specified in the binary from being overridden.
--
"There's no term to the work of a scientist." -- Walter Reisch