This is the mail archive of the
mailing list for the GCC project.
Re: paths for headers and libraries
- From: Craig Rodrigues <rodrigc at attbi dot com>
- To: David Byron <dbyron at coactive dot com>
- Cc: "'gcc at gnu dot org'" <gcc at gnu dot org>
- Date: Fri, 15 Feb 2002 17:39:08 -0500
- Subject: Re: paths for headers and libraries
- References: <7118259C3044D311942700508B2CA5BB9DD6EF@balance.coactive.com>
On Fri, Feb 15, 2002 at 02:22:39PM -0800, David Byron wrote:
> When compiling with no switches for modifying the include search path, I
> see from gcc -v that it's looking in /usr/local/include first. This is
> fine, except that when linking with -l, and no switches for modifying
> the library search path, the library gets picked up from /usr/lib.
> Is this the default behavior of gcc, or some artifact of configure
> switches or something else?
The linker on your system has a default list of directories which
it looks for libraries in. This default list is compiled
directly into the linker.
ld --verbose | grep SEARCH
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/i386-redhat-linux/lib);
Read the gcc and ld documentation for ways of changing the search path.
Using the -L flag is one way to do it.