On 12/17/2006 08:44 PM, Jens Müller wrote:
Tiago de Paula Peixoto schrieb:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x465): undefined reference to `__cxa_get_exception_ptr'
Anyone knows, what's going wrong here? Do you know if expat was compiled with a C++ compiler? Eg. g++ instead of gcc? It looks like that may be the problem.
Well, I compiled it myself and installed it in my user dir.
CC is gcc, that should be a C compiler ...
But honestly, I don't get it. Why should libexpat provide the symbol `__cxa_get_exception_ptr' if compiled with a C compiler.
I just looked at libexpat.a with mc - all the names exported look nice and unmangled. Shouldn't there a name mangling be in place if compiled as C++?
Yes, which means you used gcc to compile it. As far as I know you should have to compile expat with g++, instead of gcc, so that exceptions can be thrown from inside the hook functions, and caught outside. Otherwise the "main loop" from expat doesn't know anything about exceptions, and they wouldn't come through... This problem manifests itself with missing symbols during linkage, but honestly I don't know the details. It could be that "__cxa_get_exception_ptr" is referenced by your program, and the linker expects it to be defined in the expat library... If you compile libexpat with g++ everything should just work. -- Tiago de Paula Peixoto <tiago@forked.de>