Mail Archives: djgpp/1998/07/13/10:42:33
Date sent: Mon, 13 Jul 1998 13:13:34 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: stjacy <stjacy AT ms16 DOT hinet DOT net>
Copies to: djgpp AT delorie DOT com
Subject: Re: a strange problem about djgpp v2.1
>
> On 12 Jul 1998, stjacy wrote:
>
> > #include <typeinfo>
> > #include <math.h>
> >
> > int main()
> > {}
> >
> > The compiler complaind that there are name conflict about "exception"!
>
> This is a known problem with math.h from DJGPP v2.01: one of the
> functions there uses struct exception, and `exception' is a reserved word
> in the latest versions of C++. v2.02 corrects that.
>
> If you can't avoid using <math.h>, I suggest the following workaround
> (warning: untested code follows):
>
> #define exception __exception
> #include <math.h>
> #undef exception
> #include <typeinfo>
>
> int main ()
> {}
>
>
The problem is that gcc-2.8.1 takes math.h from $DJDIR/include
while correct version is in $DJDIR/lib/gcc-lib/djgpp/2.81/include.
This is so because it is no more need to keep $DJDIR/include
in include files search path as gcc-2.8.1 knows the default search
directories. I suggest take a look (and perhaps use) a version of
DJGPP.ENV which is included with gcc281b.zip (in directory
/gnu/gcc-2.81)
Andris
- Raw text -