[Bug preprocessor/31763] New: cc1plus fails to find some headers when include paths are duplicated
grokbrsm at free dot fr
gcc-bugzilla@gcc.gnu.org
Sun Apr 29 19:14:00 GMT 2007
when compiling this program with gcc 4.3 snapshot 2007/04/27,
#include <iostream>
int main(){
std::cout << "Hello world!" << std::endl;
}
cc1plus failed to locate the headers stddef.h and stdargs.h:
Using built-in specs.
Target: x86_64-linux
Configured with: ../gcc-4.3-20070427/configure --prefix=/home/kunzjacq/gcc
--enable-threads=posix --with-arch=opteron --enable-languages=c,c++
--enable-shared --enable-long-long --disable-multilib x86_64-linux
--disable-nls --with-mpfr=/home/kunzjacq/gcc
Thread model: posix
gcc version 4.3.0 20070427 (experimental)
/home/kunzjacq/gcc/libexec/gcc/x86_64-linux/4.3.0/cc1plus -quiet -v
-D_GNU_SOURCE solver.cpp -quiet -dumpbase solver.cpp -mtune=generic
-march=opteron -auxbase solver -version -o /tmp/ccaGy1gx.s
ignoring duplicate directory "/home/kunzjacq/gcc/include"
ignoring duplicate directory
"/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/include"
ignoring nonexistent directory
"/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../x86_64-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/home/kunzjacq/gcc/include
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/include/
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/x86_64-linux
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/backward
/usr/local/include
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/include-fixed
/usr/include
End of search list.
GNU C++ version 4.3.0 20070427 (experimental) (x86_64-linux)
compiled by GNU C version 4.3.0 20070427 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7189601d7a27b36b7c735cebc4e5f729
In file included from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/cstdlib:48,
from common.h:4,
from solver.cpp:1:
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/cstddef:48:25:
error: stddef.h: No such file or directory
In file included from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/x86_64-linux/bits/c++locale.h:50,
from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:46,
from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/ios:47,
from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/ostream:45,
from
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/iostream:45,
from common.h:6,
from solver.cpp:1:
/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/../../../../include/c++/4.3.0/cstdarg:48:25:
error: stdarg.h: No such file or directory
(...)
the path "/home/kunzjacq/gcc/lib/gcc/x86_64-linux/4.3.0/include", in which the
missing headers lie, are duplicated because I have set in the environment
C_INCLUDE_PATH="$GCC_PATH/include:$GCC_PATH/lib/gcc/x86_64-linux/4.3.0/include"
CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
where $GCC_PATH is the gcc install dir.
after these definitions are removed, everything works ok. nevertheless the
behavior of cc1plus is strange. I also found that changing the
#include_next
in
#include
in the files
$GCC_PATH/include/c++/4.3.0/{cstddef,cstdarg}
solves the problem, which is reminiscent of the following emails on the
gcc mailing list:
http://gcc.gnu.org/ml/gcc/2001-09/msg00032.html
--
Summary: cc1plus fails to find some headers when include paths
are duplicated
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grokbrsm at free dot fr
GCC build triplet: x86_64-pc-linux-gnu
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31763
More information about the Gcc-bugs
mailing list