[LCP]3 questions...

Paul Gearon pag at pisoftware.com
Fri Jul 25 08:20:02 UTC 2003


I'll leave questions 1 and 3 since I have nothing to add


Vincent Penquerc'h wrote:
>>2> If a shared library is moved, how to execute an executable program 
>>(that uses shared library) without rebuilding it?
> 
> 
> ln

Not sure why you'd want to link a shared library.  It's the job of the 
OS to find the library for you.  Specifically, it gets done by the 
runtime linker ld.so.  Look at the man page for ld.so.

Normally you'll have shared libaries in a standard library directory 
(/lib, /usr/lib and then often others like /usr/local/lib, and so forth) 
and ld.so will find it.  You can add other directories to the search 
path be adding them to the file /etc/ld.so.conf and running the program 
ldconfig.

So if ld.so knows how to find your library then your program will run 
without being rebuilt.  If ld.so doesn't know how to find the library 
then rebuilding won't help.



-- 
Regards,
Paul Gearon

Software Engineer                Telephone:   +61 7 3876 2188
Plugged In Software              Fax:         +61 7 3876 4899
http://www.PIsoftware.com        PGP Key available via finger

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam.
(Translation from latin: "I have a catapult. Give me all the money,
or I will fling an enormous rock at your head.")





More information about the linuxCprogramming mailing list