Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2002 02:10:06 +0200
From:      Alexander Langer <alex@big.endian.de>
To:        freebsd-current@FreeBSD.org
Cc:        Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Subject:   gcc 3.1 / streambuf.h broken with "using namespace std;"
Message-ID:  <20020828021006.D1412@fump.kawo2.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help
Hi!

What's going on wrong here?
GCC 2.9x can compile this, 3.1 cannot:

alex@zerogravity ~ $ cat test.cc
using namespace std;

#include <iostream>
#include <strstream>
alex@zerogravity ~ $ c++  -pipe -g -fpic -DPIC -Wall -c test.cc 
In file included from /usr/include/g++/iostream.h:31,
                 from /usr/include/g++/strstream.h:32,
                 from /usr/include/g++/strstream:6,
                 from test.cc:4:
/usr/include/g++/streambuf.h:87: syntax error before `*' token
/usr/include/g++/streambuf.h:179: syntax error before `*' token
/usr/include/g++/streambuf.h:126: warning: `class ios' only defines private 
   constructors and has no friends
/usr/include/g++/streambuf.h:180: syntax error before `*' token
/usr/include/g++/streambuf.h:180: ISO C++ forbids declaration of `_tie' with no 
   type
/usr/include/g++/streambuf.h:180: `val' was not declared in this scope
/usr/include/g++/streambuf.h:180: syntax error before `return'
In file included from /usr/include/g++/iostream.h:31,
                 from /usr/include/g++/strstream.h:32,
                 from /usr/include/g++/strstream:6,
                 from test.cc:4:
/usr/include/g++/streambuf.h:25:1: unterminated #ifndef
In file included from /usr/include/g++/strstream.h:32,
                 from /usr/include/g++/strstream:6,
                 from test.cc:4:
/usr/include/g++/iostream.h:25:1: unterminated #ifndef
In file included from /usr/include/g++/strstream:6,
                 from test.cc:4:
/usr/include/g++/strstream.h:27:1: unterminated #ifndef
In file included from test.cc:4:
alex@zerogravity ~ $

(5 day old -CURRENT)

If you remove the "using namespace std;", it works, but libh uses a lot
of header files that want to use namespace std and are includes before
header files that use strstream, and TBH I'm too lazy to add "std::" on
bazillion places manually.

#if 0
Interestingly enough, I've found a VERY similar bug report at Mirosoft's
Support base ;-)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q192539&;
#endif

Thanks for any info :)

Alex

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020828021006.D1412>