delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/12/14:44:42

Message-ID: <37B27F9B.B0579C90@softhome.net>
Date: Thu, 12 Aug 1999 10:02:35 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.61 [en] (Win98; I)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: parse error on 'using namespace std;'
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990808143833 DOT 23423p-100000 AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Thu, 5 Aug 1999, dnult wrote:
> 
> > int main() {
> >    using std::copy;
> >    using std::cout;
> >    ...
> >
> > The compiler complains "In function int main(), parse error before 'using'".
> > If I comment out the namespace specifiers the code compiles fine, (but
> > doesn't run).
> 
> GCC 2.8.1 doesn't support namespaces, AFAIK.

The only support for namespaces in GCC 2.8.1 is that compiler
compiles 'using namespace std;' as no-op.

If you want full namespace support, EGCS 1.1.x and GCC 2.95
implements it. But standard C++ library of those compiler
hasn't put in namespace std. It will be so in GCC 3.0.
However, you can try to use flags -fhonor-std -DHONOR-STD
(can't recall correctly) and see if it puts library in namespace
std.

Laurynas Biveinis

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019