delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/05/08:07:34

Message-Id: <3.0.2.32.19981105140208.00711000@tex.lineanet.net>
X-Sender: delfo AT tex DOT lineanet DOT net
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.2 (32)
Date: Thu, 05 Nov 1998 14:02:08 +0100
To: djgpp AT delorie DOT com
From: Stefano Del Furia <delfo AT tech-center DOT com>
Subject: exception error
Mime-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id IAA16317
Reply-To: djgpp AT delorie DOT com

Dear users,
when you try to compile a program that needs to include the vector and the
math.h files, you have some error.
DJGPP 2.8.1 in dos environment.


Examples.
try to compile this simple source

#include <vector>
#include <math.h>

main()
{
}


you get a lot of errors-

c:/djgpp/lib/gcc-lib/djgpp/2.81/include/exception(20) Error: previous declara
c:/djgpp/include/math.h(79) Error: conflicts with new declaration with C link
c:/djgpp/lib/gcc-lib/djgpp/2.81/include/exception(20) Error: previous declara
c:/djgpp/include/math.h(79) Error: conflicts with new declaration with C link
There were some errors


this because there's a multiple declaration in either files
in <vector>
class exception


in <math.h>
struct exception



The only workaround is to define EXCEPTION before the <vector> include

#include <math.h>
#define __EXCPTION__
#include <vector>

main()
{
}


Is this a feature or a bug ?
TIA
 >>scritta da                             ''~``
 Stefano Del Furia                       ( o o )
  __________________________________.oooO--(_)--Oooo._
 | ___/ / _/__ www.geocities.com/SiliconValley/3546/  |
 |/ _  / _(_-< Dipartimento di Informatica            |
 |\_,_/_//___/ delfo AT tech-center DOT com  .oooO           |
 |ITIS "E.FERMI" Bibbiena 52010 AR IT (   )   Oooo.   |
 |_____________________________________\ (____(   )___| 
 La TEORIA è quando si conosce tutto,   \_)    ) /
    ma non funziona niente.                   (_/
 La PRATICA è quando funziona tutto,
    ma non si sa il perché.
 Il nostro obiettivo è unire TEORIA e PRATICA
 (-: Non funziona NIENTE e non si sa il PERCHE' :-)

- Raw text -


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