Re: /usr/lib vs. /usr/local/lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 15, 2010 at 6:34 AM, Alfred M. Szmidt <ams@xxxxxxx> wrote:
>   Is "/usr/local/lib" still searched before "/usr/lib" by GCC by
>   default?  If not, is there a way to force GCC to search
>   /usr/local/lib first?
>
> GCC does search /usr/local/lib before /usr/lib (you can use gcc
> -print-search-dirs to see the exact details for your configuration)
> when linking, but your dynamic loader might not (which is what ldd
> calls, and what is used when you run the program).  I think just
> modifying /etc/ld.so.conf and putting /lib before /usr/local/lib (or
> adding them in that order) should do the trick for you.  Don't forget
> to run ldconfig after modifying ld.so.conf.
>

I am using Ubuntu 9.10 and it had the ld.so.conf as following:

/etc$ cat ld.so.conf
include /etc/ld.so.conf.d/*.conf
/etc/ld.so.conf.d$ ls -l
total 12
-rw-r--r-- 1 root root 64 2008-09-29 03:32 i486-linux-gnu.conf
-rw-r--r-- 1 root root 18 2008-10-07 17:37 libasound2.conf
-rw-r--r-- 1 root root 44 2008-09-29 03:32 libc.conf
/etc/ld.so.conf.d$

i am wondering in what order the above three .conf will be included in
ld.so.conf.

thanks.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux