g++ can't locate iosfwd

Maciej Bliziński maciej@opencsw.org
Wed Aug 24 22:38:00 GMT 2011


2011/8/21 Maciej Bliziński <maciej@opencsw.org>:
> 22203:  stat64("/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.1/include/iosfwd.gch",
> 0xFFBFF038) Err#2 ENOENT
> 22203:  open64("/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.1/include/iosfwd",
> O_RDONLY|O_NOCTTY) Err#2 ENOENT
> 22203:  stat64("/opt/csw/gcc4/include/iosfwd.gch", 0xFFBFF038) Err#2 ENOENT
> 22203:  open64("/opt/csw/gcc4/include/iosfwd", O_RDONLY|O_NOCTTY) Err#2 ENOENT
> 22203:  stat64("/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.1/include-fixed/iosfwd.gch",
> 0xFFBFF038) Err#2 ENOENT
> 22203:  open64("/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.6.1/include-fixed/iosfwd",
> O_RDONLY|O_NOCTTY) Err#2 ENOENT
> 22203:  stat64("/usr/include/iosfwd.gch", 0xFFBFF038)   Err#2 ENOENT
> 22203:  open64("/usr/include/iosfwd", O_RDONLY|O_NOCTTY) Err#2 ENOENT
>
> Where is the problem - are the header files misplaced, or is g++
> looking in the wrong place?

I compared the new build with the previous build of gcc (4.3.3), and
found how does gcc find this header file.  The files in the old build
are in the same place, but gcc is able to find them:

6414:   stat("/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../../include/c++/4.3.3/iosfwd.gch",
0xFFBFF2B8) Err#2 ENOENT
6414:   open("/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../../include/c++/4.3.3/iosfwd",
O_RDONLY|O_NOCTTY) = 4

Interestingly, it looks like the include files are found underneath
what was probably configured as libdir (PREFIX/lib).  In my build,
I've defined prefix to /opt/csw/gcc4, but I have set libdir to
/opt/csw/lib.  How does gcc get the idea to search
/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../../include/c++/4.3.3
for the include files? Is it defined in a file such as config.h?

Maciej



More information about the Gcc-help mailing list