This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is "__gxx_personality_sj0"?


On 22 February 2011 10:02, Tihomir Mitkov wrote:
> I'm trying to compile a program with a library downloaded from
> internet (Regular Expression implementation). I compile both my code
> and the library with mingw gcc 4.4.3 with no problem. When I try to
> link the library with my app `ld' complains about undefined references
> to `__gxx_personality_sj0' , `std::allocator<char>
>>::basic_string(std::string const&)', ?`_Unwind_SjLj_Unregister' and
> some others. The error messages are many (probably hundreds).

Your question is off-topic for this list, please send requests for
help using or building gcc to gcc-help@gcc.gnu.org. Please take any
follow-up questions to that list, thanks.

> According to what I have found in the Internet these errors come when
> attempting to link object files compiled with different versions of
> gcc. But I compiled them with only one and I used the `ld' that comes
> with mingw.

No, it sounds as though you're trying to use the 'gcc' program to
build C++ code.  That will compile the code, but will not link to the
C++ runtime library, which causes the linker errors you're getting.

This is documented in the manual, which you should read:
http://gcc.gnu.org/onlinedocs/gcc-4.4.5/gcc/Invoking-G_002b_002b.html

The easiest solution to your problem is probably to use 'g++' for C++
programs instead of 'gcc'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]