[ale] How do I force a specific version of a shared library to be loaded/used?

Keith Hopkins hne at hopnet.net
Wed Jun 14 11:49:33 EDT 2006


Jim wrote:
> Jim wrote:
>> I have two versions of mysqlclient installed on the system, 
>> mysqlclient.so.14 and mysqlclient.so.12.  I'm compiling/running a 
>> program that needs to be linked to 14, but it's defaulting to 12.  How 
>> do I encourage it to link to 14?  Google wasn't much help.
>>
>> Thanks,
>> Jim.
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://www.ale.org/mailman/listinfo/ale
>>
>>
>>
>>   
> Never mind.  I didn't have libmysqlclient14-dev installed.  Sorry for 
> the wasted bandwidth.
> 
> Jim.
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> !DSPAM:44902e87158561988011713!
> 

Interesting question, which I just bothered to look up, so I'll tell you anyway:

man ld.so

 The shared libraries needed by the program are searched for in various places:

       o      (ELF only) Using the DT_RPATH dynamic section attribute of the binary if present and DT_RUNPATH attribute does not exist.   Use
              of DT_RPATH is deprecated.

       o      Using  the  environment variable LD_LIBRARY_PATH.  Except if the executable is a set-user-ID/set-group-ID binary, in which case
              it is ignored.

       o      (ELF only) Using the DT_RUNPATH dynamic section attribute of the binary if present.

       o      From the cache file /etc/ld.so.cache which contains a compiled list of candidate libraries previously found  in  the  augmented
              library  path.  If,  however,  the binary was linked with -z nodeflib linker option, libraries in the default library paths are
              skipped.

       o      In the default path /lib, and then /usr/lib.  If the binary was linked with -z nodeflib linker option, this step is skipped.


Setting LD_LIBRARY_PATH is the method I see used most often.

--
Somewhere 1/2 way around the globe,
  Keith




More information about the Ale mailing list