help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libraries for exception handling?


From: David Olsson
Subject: Libraries for exception handling?
Date: 21 Sep 2004 01:58:09 -0700

Hello!

I'm using a GCC toolchain to develop a C++ application for an ARM
processor. The application uses RTTI and exception handling. I use no
STL stuff or any other standard functions/classes (its a rather small
application). Compiling the sources of a small sample works fine.
However, when I link the object files I get the following errors;

undefined reference to `_Unwind_SjLj_Register'
undefined reference to `__cxa_allocate_exception'
undefined reference to `__cxa_throw'
undefined reference to `__cxa_begin_catch'
undefined reference to `__cxa_end_catch'
undefined reference to `_Unwind_SjLj_Unregister'
undefined reference to `__gxx_personality_sj0'
undefined reference to `typeinfo for char const*'

The sample code looks like this;

extern "C" void start(void) {
        try {
                throw("Hello!");
        }
        catch(...) {
        }
}

As you might have guessed, I link without any default libaries. If I
link with the libraries "-lgcc -lsupc++ -lc" (in that order), the
undefined references resolve and it links just fine. My problem is
that the platform I'm developing for doesn't allow for the use of the
standard library's malloc() and free() which makes it rather difficult
to use the C standard library.

Does anyone have an idea on how I could solve this problem? I'd rather
not have to implement all exception handling functions for this
platform... :-)

Any help appreciated!
David Olsson


reply via email to

[Prev in Thread] Current Thread [Next in Thread]