www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/16/17:16:56

From: wjae AT plex DOT nl (Wiel Aerts)
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with including headers; redifinition
Date: Thu, 16 Apr 1998 18:12:31 GMT
Organization: Plex -- a public access Internet provider
Lines: 82
Message-ID: <353649bd.8054605@news.plex.nl>
NNTP-Posting-Host: news.plex.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I was trying to use some parts of the gpp library and
got some problems with including headers. I came to a simple program 
that shows the problem:

Program:

#include <queue>
#include <complex>

int main ()
{
        return 0;
}

Compiling with:

g++ -Wall -fsjlj-exceptions test.cpp -o f.exe -lm

and the output:

In file included from c:/djgpp/lang/cxx/cmath:7,
                 from c:/djgpp/lang/cxx/std/complext.h:34,
                 from c:/djgpp/lang/cxx/complex:7,
                 from test.cpp:2:
c:/djgpp/include/math.h:73: redefinition of `class exception'
c:/djgpp/lib/gcc-lib/djgpp/2.80/include/exception:20: previous
definition here
c:/djgpp/lib/gcc-lib/djgpp/2.80/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.80/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

Switching the two include's:

#include <complex>
#include <queue>

int main ()
{
        return 0;
}

Gives the output:

In file included from c:/djgpp/lib/gcc-lib/djgpp/2.80/include/new:9,
                 from c:/djgpp/lib/gcc-lib/djgpp/2.80/include/new.h:6,
                 from c:/djgpp/lang/cxx/stlalgobase.h:52,
                 from c:/djgpp/lang/cxx/queue:30,
                 from test.cpp:2:
c:/djgpp/lib/gcc-lib/djgpp/2.80/include/exception:15: redefinition of
`struct exception'
c:/djgpp/include/math.h:79: previous definition here
c:/djgpp/include/math.h:79: previous declaration of
`exception::exception()' with C linkage
c:/djgpp/lib/gcc-lib/djgpp/2.80/include/exception:17: conflicts with
new declaration with C++ linkage
c:/djgpp/include/math.h:79: previous declaration of
`exception::exception(const struct exception &)' with C linkage
c:/djgpp/lib/gcc-lib/djgpp/2.80/include/exception:20: conflicts with
new declaration with C++ linkage
c:/djgpp/include/math.h:79: previous declaration of `struct exception
& exception::operator =(const struct exception &)' with C linkage
c:/djgpp/lib/gcc-lib/djgpp/2.80/include/exception:20: conflicts with
new declaration with C++ linkage


I am a newbie with djgpp and  I really don't understand.

Can somebody help me?

Thanks,

Wiel Aerts

PS: Win95, gcc280b.zip and gpp280b.zip, djgpp.env not edited.

- Raw text -


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