This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is "__gxx_personality_sj0"?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Tihomir Mitkov <mitkovtihomir at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 22 Feb 2011 10:24:41 +0000
- Subject: Re: What is "__gxx_personality_sj0"?
- References: <AANLkTikKGxE_fp3q9JrkQC5vG3zaqrvimNi+GOMLnhjY@mail.gmail.com> <AANLkTinm2Cs87z=2a5uQLPr7pyFF7o6cZYRUrxsdCOAh@mail.gmail.com>
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'