Mail Archives: djgpp/1998/06/17/02:55:21
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.
- Raw text -