www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/21/11:31:19

Message-ID: <01BDCD1B.3FD70870@TAURUS>
From: "Steve Higgins" <steve AT psp-digital DOT co DOT uk>
To: "'DJGPP Mail List'" <djgpp AT delorie DOT com>
Subject: Duplicate definition in two different include files.
Date: Fri, 21 Aug 1998 15:49:07 +0100
MIME-Version: 1.0

Hi Guys, 

I was compiling some old code that compiled correctly with version 271 but fails with  version 281.
Its easy to reproduce.

Create a c++ file which just has the following 2 lines:-

#include <new.h>
#include <math.h>

At the dos prompt type "make testit" to get the following error messages.

make testit
gcc     testit.cc   -o testit
In file included from testit.cc:2:
c:/djgpp/include/math.h:73: redefinition of `class exception'
c:/djgpp/lib/gcc-lib/djgpp/2.81/include/exception:20: previous definition here
c:/djgpp/lib/gcc-lib/djgpp/2.81/include/exception:20: previous declaration of `exception::exception(const struct exception &)' with C++ linkage
c:/djgpp/include/math.h:79: conflicts with new declaration with C linkage
c:/djgpp/lib/gcc-lib/djgpp/2.81/include/exception:20: previous declaration of `struct exception & exception::operator =(const struct exception &)' with C++ linkage
c:/djgpp/include/math.h:79: conflicts with new declaration with C linkage
make.exe: *** [testit] Error 1

Compilation exited abnormally with code 2 at Fri Aug 21 15:44:52

As you can see there is a duplicate definition. causing the compile failure.

Has anyone else seen this? 
Which one should I redefine and to what to keep compatibility with bug fixes?

Regards

Steve.

- Raw text -


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