LD search order...mistake in man pages?

Thomas Wolf wolf at mink.att.com
Fri Jan 11 05:26:52 AEST 1991


I recently tried building a program that used X11R3.  Because I kept the
X11R3 libraries in a "non-standard" place, I invoked 'ld' with the '-L'
option.  However, I also have the LD_LIBRARY_PATH variable set (to
'/usr/lib:$OPENWINHOME/lib').  Instead of resolving references using the
-L provided directory, the linker appears to garner the references from my
/usr/lib libraries (which is where I keep my X11R4 libraries), because
when I do an 'ldd' on the executable, shared libraries in that directory
are given.

Contrary to what the man pages for 'ld' state, the LD_LIBRARY_PATH
directories appear to be searched BEFORE -L specified dirs.  Am I missing
some subtle point, or are the man pages wrong?

Thanks for any info.

| Thomas Wolf   | (201) 615-4789  
| Bell Labs, NJ | wolf at mink.att.com



More information about the Comp.sys.sun mailing list