This is the mail archive of the gcc@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: paths for headers and libraries


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


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