This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: /usr/lib vs. /usr/local/lib
- From: "Alfred M. Szmidt" <ams at gnu dot org>
- To: Han <keepsimple at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 15 Jan 2010 09:34:02 -0500
- Subject: Re: /usr/lib vs. /usr/local/lib
- References: <37666aa81001142335n39b104d2m8142f42763d2cb8c@mail.gmail.com>
- Reply-to: ams at gnu dot org
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.