This is the mail archive of the gcc-bugs@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]

Symbolic link in include path, doesn't work


My g++ didn't work in the following way:

inputfile test.cc:
#include <iostream>

main()
{}

~$ g++ test.cc   
test.cc:1: iostream: No such file or directory


And the cause was that I had made a symbolic link in /usr to 'lib' on
another partition.

/usr$ ls -l lib
lrwxrwxrwx    1 root     root           15 Dec 12 15:11 lib -> /space/usr/lib//


therefore

 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3

was not equal to 

 /usr/include/g++-3

but to
 
 /space/usr/include/g++-3

which didn't exist.

I made it exist, and after that things worked, and it looks now like
this (with -v so that you see the version which I use):

~$ g++ -v test.cc
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ test.cc /tmp/ccpkg3wd.ii
GNU CPP version 2.95.2 20000313 (Debian GNU/Linux) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
 /usr/lib/gcc-lib/i386-linux/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
End of omitted list.
 /usr/lib/gcc-lib/i386-linux/2.95.2/cc1plus /tmp/ccpkg3wd.ii -quiet -dumpbase test.cc -version -o /tmp/cccO3tmy.s
GNU C++ version 2.95.2 20000313 (Debian GNU/Linux) (i386-linux) compiled by GNU C version 2.95.2 20000313 (Debian GNU/Linux).
 as -V -Qy -o /tmp/ccE1LZEA.o /tmp/cccO3tmy.s
GNU assembler version 2.9.5 (i386-linux) using BFD version 2.9.5.0.41
 /usr/lib/gcc-lib/i386-linux/2.95.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-linux/2.95.2/crtbegin.o -L/usr/lib/gcc-lib/i386-linux/2.95.2 /tmp/ccE1LZEA.o -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-linux/2.95.2/crtend.o /usr/lib/crtn.o


I don't know if this is really a bug for gcc, or perhaps more for
debian or for the program responsible for that /usr/lib/.. not is
equal to /usr if lib is a symbolic link, but anyhow it can be quite
annoying (it costs me several days before realising that this could be
the problem).


  greetings,

  Michiel


-- 
% Michiel Meeuwissen
% M.Meeuwissen@stud.warande.ruu.nl
% http://www.purl.org/NET/mihxil/
% Vidu ankaux: http://www.uea.org/katalogo/eeb.cgi

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