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]

question about -print-search-dirs


Perhaps a kind person would explain what -print-search-dirs is printing.
The manual entry is not very enlightening.

When I do

%gcc -print search-dirs

I get output of which the "libraries=" line lists the following libraries

libraries: =/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/
:/usr/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/
:/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../x86_64-unknown-linux-gnu/lib/x86_64-unknown-linux-gnu/4.1.1/
:/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../x86_64-unknown-linux-gnu/lib/
:/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../x86_64-unknown-linux-gnu/4.1.1/
:/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../
:/lib/x86_64-unknown-linux-gnu/4.1.1/
:/lib/
:/usr/lib/x86_64-unknown-linux-gnu/4.1.1/
:/usr/lib/

Yet if I do

% gcc -v -o hello hello.c

for a simple "hello world" program, then the libraries listed
(following "-L") are

-L/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1
-L/usr/local/gcc-4.1.1/x86_64-Linux/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../lib64
-L/lib/../lib64
-L/usr/lib/../lib64

I guess I would have expected that the two lists of libraries would be the same,
or perhaps that the second list would be contained in the first.  But
this does not
seem to be the case.

What am I missing?

Kate Minola
University of Maryland, College Park


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