paths for headers and libraries
Craig Rodrigues
rodrigc@attbi.com
Fri Feb 15 14:43:00 GMT 2002
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.
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@attbi.com
More information about the Gcc
mailing list