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]

Re: Problem with g++ in gcc version 3.0 20010402


Alexandre Oliva writes:
 > On Apr  5, 2001, David Ronis <ronis@ronispc.chem.mcgill.ca> wrote:
 > 
 > > test.C:3: `cout' undeclared (first use this function)
 > 
 > Make it std::cout

I made the change, but it still doesn't find the includes (no suprise really).

Here's the log.  Notice the bogus directories.

/usr/bin/g++ -v test.C
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc/configure --host=i686-pc-linux-gnu --prefix=/usr --with-gnu-as --enable-shared --with-gnu-ld --enable-threads=posix
gcc version 3.0 20010402 (prerelease)
 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ test.C -D__GNUG__=3 -D_GNU_SOURCE -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase test.C -version -o /tmp/cc64LOUZ.s
GNU CPP version 3.0 20010402 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0 20010402 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.0 20010402 (prerelease).
ignoring nonexistent directory "/usr/include/g++-"
ignoring nonexistent directory "/usr/include/g++-/i686-pc-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
 /usr/i686-pc-linux-gnu/include
 /usr/include
End of search list.
test.C:1:20: iostream: No such file or directory
test.C: In function `int main()':
test.C:3: `cout' undeclared in namespace `std'


I added -I/usr/include/g++-v3 and it still doesn't compile.  Lots
of error messages, basically all coming from not finding missing
include files (all in ../i686-pc-linux-gnu/bits).  After I made some
links to the files in missing in bits from those in
../i686-pc-linux-gnu/bits it works.

Clearly something isn't right.  

Moreover, if you're going to require std::cout in every instance of
cout, you're going to break tons of existing code.  The code example I
posted comes from the configure script for ddd; I shudder to think
what would happen in the actual build.  Not to start a debate with
code-lawyers, but just for laughs, I checked a couple of introductory
books on C++.  They all had one of the first code examples containing
cout << "Hello World".

David









































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