c++ - undefined reference to `__gxx_personality_sj0 -
with gcc 4.6 when trying execute code:
#include <iostream> using namespace std; #include <bitset> int main() { //int<> a; long long min = std::numeric_limits<int>::min(); unsigned long long max = std::numeric_limits<int>::max(); cout << "min: " << min << '\n'; cout << "max: " << max << '\n'; cout << (min <= max); std::bitset<64> minimal(min); cout << "minimal: " << minimal; return 0; }
i'm getting following error:
1. undefined reference __gxx_personality_sj0
_unwind_sjlj_register'
2. undefined reference to
3. undefined reference _unwind_sjlj_unregister'
_unwind_sjlj_resume'
4. undefined reference to
what on hell going on?!
these functions part of c++ exception handling support gcc. gcc supports 2 kinds of exception handling, 1 based on calls setjmp , longjmp (sjlj exception handling), , based on dwarf debugging info format (dw2 exception handling).
these sorts of linker errors occur try mix objects compiled different exception handling implementations in single executable. appears using dw2 gcc, library attempting use compiled sjlj version of gcc, leading these errors.
the short answer these sorts of problems caused abi incompatibilities between different compilers, , occur when mix libraries compiled different compilers, or use incompatible versions of same compiler.
Comments
Post a Comment