This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Fri, Jan 15, 2010 at 6:21 AM, Tim Prince <n8tm@aol.com> wrote:
> Han wrote:
>
>> 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?
>>
>
> gcc doesn't control this. ?I hope you are misquoting the textbook.
> Presumably, you are running under a shell which supports setting the search
> order in PATH and LD_LIBRARY_PATH .... environments. In certain common linux
> systems, the default order changes according to the path you use to login
> (ssh, telnet, console,....).
>

it seems my shell does not have LD_LIBRARY_PATH...

$ echo $LD_LIBRARY_PATH
$
$ env | grep LD_LIBRARY_PATH
$


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]