undefined reference to `__gxx_personality_sj0-Collection of common programming errors

These functions are part of the C++ exception handling support for GCC. GCC supports two kinds of exception handling, one which is based on calls to setjmp and longjmp (so called sjlj exception handling), and another which is based on the DWARF debugging info format (so called DW2 exception handling).

These sorts of linker errors will occur is you try to mix objects that were compiled with different exception handling implementations in a single executable. It appears that you are using a DW2 GCC, but some library that you are attempting to use was compiled with a sjlj version of GCC, leading to these errors.

The short answer is that these sorts of problems are caused by ABI incompatibilities between different compilers, and so occur when you mix libraries compiled with different compilers, or use incompatible versions of the same compiler.

Originally posted 2013-11-09 23:16:18.