delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/13/10:42:33

Message-ID: <B0000035047@stargate.astr.lu.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: stjacy <stjacy AT ms16 DOT hinet DOT net>, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Date: Mon, 13 Jul 1998 17:39:09 +0300
MIME-Version: 1.0
Subject: Re: a strange problem about djgpp v2.1
CC: djgpp AT delorie DOT com
References: <01bcea00$1bf6f400$ad0620a3 AT nydia-3>
In-reply-to: <Pine.SUN.3.91.980713130956.2775A-100000@is>

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 -


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