delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/13/06:15:17

Date: 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>
cc: djgpp AT delorie DOT com
Subject: Re: a strange problem about djgpp v2.1
In-Reply-To: <01bcea00$1bf6f400$ad0620a3@nydia-3>
Message-ID: <Pine.SUN.3.91.980713130956.2775A-100000@is>
MIME-Version: 1.0

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 ()
  {}

- Raw text -


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