[svlug] modify default directory search order for GCC

Fabrizio Bertocci fabriziobertocci at gmail.com
Tue Aug 8 11:38:23 PDT 2006


On 8/8/06, tony yu <yutaotao at gmail.com> wrote:
>
> ...
> and it should be like that, as -L. puts the additional directory AFTER the
> default order.
>
> and running mytest will still use /usr/libz.so even I export
> LD_LIBRARY_PATH=. as it is already located during linking time.
>
> My question is, and hope, someone has seen it before,
>
> how do I make my exectuable use the one I desired (in current directory)
> instead of the one at /usr/lib?
>


My take on this is that Linux doesn't do any pre-binding at compile time,
but everything is resolved at run-time.
You can ignore the fact that gcc is using your libz from /usr.
The problem is the runtime.
Did you try to give to LD_LIBRARY_PATH an absolute path instead of a
relative path?
What does 'ldd' shows after that?
What happen if you 'hide' (temporarily) your /usr/libz.so? Does ldd see your
local one?
Try to change the search order from /etc/ld.so.conf and re-run ldconfig.

Fabrizio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kenny.linuxmafia.com/pipermail/svlug/attachments/20060808/cba00684/attachment.htm 


More information about the Svlug mailing list