This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
STL includes don't seem to take effect in g++ 3.0.2
- To: gcc-help at gcc dot gnu dot org
- Subject: STL includes don't seem to take effect in g++ 3.0.2
- From: Jeremy Lin <jjlin at OCF dot Berkeley dot EDU>
- Date: Fri, 2 Nov 2001 21:26:57 -0800 (PST)
I recently built gcc 3.0.2 on solaris 8, and g++ won't compile programs
using the STL (gcc works fine though). For example, this simple program:
#include <iostream>
int main ()
{
cout << "hello world" << endl;
return 0;
}
yields:
hello.cc: In function `int main()':
hello.cc:5: `cout' undeclared (first use this function)
hello.cc:5: (Each undeclared identifier is reported only once for each
function it appears in.)
hello.cc:5: `endl' undeclared (first use this function)
Running with -v gives:
---
Reading specs from
/opt/local/gnu/packages/gcc-3.0.2/lib/gcc-lib/sparc-sun-solar
is2.8/3.0.2/specs
Configured with: ../gcc-3.0.2/configure --prefix=/opt/local/gnu/packages/gcc-3.0
.2 --enable-languages=c,c++,objc,f77
Thread model: posix
gcc version 3.0.2
/opt/local/gnu/packages/gcc-3.0.2/lib/gcc-lib/sparc-sun-solaris2.8/3.0.2/cc1plu
s -v -iprefix
/opt/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.0.2/ -D__
GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=2 -Dsparc -Dsun -Dunix
-D__svr
4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__
sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__
-D__STDC_HOSTED__=1 -D_
XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
-D__EXTENSIONS__
-D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc hello.cc -D__GNUG__=3
-D__GXX_
DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase
hello.cc -version -o /var/tmp/cc9mB0Fc.s
GNU CPP version 3.0.2 (cpplib) (sparc)
GNU C++ version 3.0.2 (sparc-sun-solaris2.8)
compiled by GNU C version 3.0.2.
ignoring nonexistent directory
"/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/
3.0.2/../../../../include/g++-v3"
ignoring nonexistent directory
"/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/
3.0.2/../../../../include/g++-v3/sparc-sun-solaris2.8"
ignoring nonexistent directory
"/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/
3.0.2/../../../../include/g++-v3/backward"
ignoring nonexistent directory
"/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/3.0.2/include"
ignoring nonexistent directory
"/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/
3.0.2/../../../../sparc-sun-solaris2.8/include"
ignoring nonexistent directory
"/opt/local/gnu/packages/gcc-3.0.2/sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/gnu/packages/gcc-3.0.2/include/g++-v3
/opt/local/gnu/packages/gcc-3.0.2/include/g++-v3/sparc-sun-solaris2.8
/opt/local/gnu/packages/gcc-3.0.2/include/g++-v3/backward
/usr/local/include
/opt/local/gnu/packages/gcc-3.0.2/lib/gcc-lib/sparc-sun-solaris2.8/3.0.2/includ
e
/usr/include
End of search list.
<snip - previous error messages go here>
---
So it seems to be searching the proper paths, and in fact, trussing
everything shows that the include files are being read by cc1plus. We have
a g++ 2.95.2 that works fine, also. I'd really appreciate it if anyone
could offer any ideas about how to fix this.
Thanks,
Jeremy