TOC  
Previous  
Next
LD_LIBRARY_PATH
We need to give the dynamic linker information on how
to find our shared library at run-time
One solution: 
LD_LIBRARY_PATH.
- Set this environment variable
to a list of colon-separated directories.
 
 
- 
Dynamic linker searches these directories 
before looking in standard library directories.
$ LD_LIBRARY_PATH=. ./prog
Called mod1-x1
Called mod2-x2
 
Note: production applications should not use 
LD_LIBRARY_PATH.
- 
Users should not have to know where the library is located.
 
 
- 
LD_LIBRARY_PATH is ignored for set-user-ID and
set-group-ID programs.
(C) 2006, Michael Kerrisk