Date: Tue, 11 Feb 1997 19:21:04 +0200 (IST) From: Eli Zaretskii To: Matthias Baas cc: djgpp AT delorie DOT com Subject: Re: typeinfo.h and math.h conflict In-Reply-To: <5dp7r4$gui$1@nz12.rz.uni-karlsruhe.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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?