www.delorie.com/djgpp/v2faq/faq069.html | search |
| Previous | Next | Up | Top |
Q: When linking C++ programs, I get messages about undefined references to __EH_FRAME_BEGIN__
and such likes. Huh?
Q: I cannot compile C++ programs that include the header math.h: the compiler complains about redefinition of class exception!
Note that exception support with -fsjlj-exceptions is very slow, since it has a significant runtime overhead, even if the exception doesn't occur.
If you already use GCC 2.8.1, these problems could happen if you failed to replace the specs file with the version which comes with the GCC 2.8.1 distribution. Read the file README.DJGPP in the GCC distribution, for more details.
Exception support in GCC is generally not stable enough yet, so you need to treat with some suspicion code produced by GCC 2.8.1 for programs that use exceptions.
Undefined references to symbols like __EH_FRAME_BEGIN__
are a symptom of using an old linker script djgpp.djl. You should remove this file from your lib
subdirectory, which lets GCC use the new version that installs into the lib/gcc-lib/djgpp/X.YZ/ directory (where X.YZ is the GCC version number). Again,
README.DJGPP in the GCC distribution has more on this.
If GCC complains about "Redefinition of class exception" when you compile C++ programs which include the header math.h, you need to replace that header. GCC 2.8.1 comes with a
header exception that conflicts with math.h from DJGPP v2.01, which defines a struct exception
. Version 2.02 of DJGPP will correct math.h, and a
corrected version is included in the gcc281b.zip distribution. The corrected math.h is installed into the lib/gcc-lib/djgpp/2.81/include directory, so either
delete or rename the old version in the include directory, or copy the corrected version into include. Another solution is to compile with the -posix or
-ansi compiler switch, which cause math.h to not define struct exception
.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)