Date: Wed, 17 Jun 1998 09:54:48 +0300 (IDT) From: Eli Zaretskii To: Gerhard Gruber cc: djgpp AT delorie DOT com Subject: Re: Question concerning gcc and C++ In-Reply-To: <3592e0a4.5385268@news.Austria.EU.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 16 Jun 1998, Gerhard Gruber wrote: > I thought that calling gcc with the language option should switch to the the > appropriate mode. But I get errors compiling this file and it appears as if > the compiler still doesn't switch correctly to C++ mode. > > I get the follwing message: > > In file included from d:/gnu/lang/cxx/libio.h:30, > from d:/gnu/lang/cxx/streambuf.h:36, > from d:/gnu/lang/cxx/iostream.h:31, > from test.c:2: > d:/gnu/lang/cxx/_G_config.h:20: parse error before `__extension__' > In file included from test.c:2: > d:/gnu/lang/cxx/iostream.h:91: parse error before `__extension__' > d:/gnu/lang/cxx/iostream.h:208: parse error before `__extension__' This seems like GCC *does* compile the program as C++: it uses the C++ include directory in lang/cxx. So your problem is elsewhere. Can it be that you mix headers from GCC 2.7.2 with binaries from GCC 2.8.x? > The source is the same as I got it from the poster: Since the problem is in the headers, there's no use in posting the source of the program: GCC doesn't complain about the source at all.