/usr/lib vs. /usr/local/lib

Han keepsimple@gmail.com
Fri Jan 15 07:35:00 GMT 2010


Hi,

>From what I learned (e.g. the book "An introduction to GCC" by Brian
Gough), /usr/local/lib is searched _before_ /usr/lib by gcc linker for
libraries. However, using ldd I can see my program always linked to
the libraries from /usr/lib, even when the same library exists under
both /usr/lib and /usr/local/lib.

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?

Thank you.
Han



More information about the Gcc-help mailing list