Mail Archives: djgpp/1997/02/11/12:30:30
On Tue, 11 Feb 1997, Matthias Baas wrote:
> g:/lang/cxx/std/stdexcep.h:58: previous declaration of `struct
> exception & exception::operator =(const struct exception &)' with C++
> linkage
> g:/include/math.h:79: conflicts with new declaration with C linkage
> g:/include/math.h:79: confused by earlier errors, bailing out
>
> So why is there a class named "exception" in math.h and how can I
> use math.h and exception handling together in my programs?
With all due respect, it helps to actually look inside math.h instead of
expecting others to do that for you. No offence. Really.
Here's the scoop: math.h doesn't declare a class named ``exception'' (of
course), it defines a ``struct exception''. I don't know whether this is
just an incompatibility between GCC 2.7.2.1 and libg++ 2.7.1 (anybody?),
but as far as I could see, if you compile your source with -posix, the
problem will go away. (However, I didn't actually try this, so I might
be mistaken.)
As for the real solution, is there somebody on this group who knows about
namespaces in the current C++ draft standard and can suggest a
solution? One possibility is obviously to rename that struct, but that
could break existing software. Anybody?
- Raw text -