Undefined Reference to '_Gxx_Personality_Sj0'

Link error undefined reference to `__gxx_personality_v0' and g++

If g++ still gives error Try using:

g++ file.c -lstdc++

Look at this post: What is __gxx_personality_v0 for?

Make sure -lstdc++ is at the end of the command. If you place it at the beginning (i.e. before file.c), you still can get this same error.

Undefined reference to _Unwind_Resume and __gxx_personality_v0

I finally fixed this by importing into Code::Blocks the source code of JsonCpp and creating the library myself. I am still baffled though as to why the library created with Scons didn't work, since it was using the same compiler that Code::Blocks uses, but at the same time it was not ( or the error wouldn't have been there ).

Undefined reference to `_Unwind_Resume' with QT

  1. I download and installed a Qt library alone (i didn't download the whole SDK)
  2. I Wrote a simple Hello Qt window..
  3. I link it with my Dev-Cpp (since Dev-Cpp is using MinGW as well) mine version actually is 3.4.x not 4.4.x...
  4. I compile it the Qt way using qmake .. etc..
  5. I got an error you have experienced as well..

... "_Unwind_Resume ..." ...

My Solution (simple, very simple)

  1. Run the Qt X.X.X. (Build Debug Libraries) or..
  2. Run the qtvars.bat (depending on the version of Qt you are using) mine is 4.8.0..
  3. 1 and 2 are the same thing..

I did a hit of make again.. it runs..:)

p.s. it solves my problem.:) I hope it can solve yours too.

The procedure entry point __gxx_personality_sj0 could not be located in...

In the end, it turned out that the problem was caused by a wayward libstdc++-6.dll somewhere in $PATH. After ensuring that the copy built by Mingw-w64 was in the application's directory, everything worked.

Xcode: why does renaming to .mm fail with undefined symbol ___gxx_personality_sj0 in static library only?

When you create a static library you don't link in the dependent libraries. As a result, when you rename one of the files from .m to .mm it starts to now depend on C++ features such as stack unwinding when receiving exceptions. Even if you tell the compiler that you have no intent of using exceptions (by the denial of C++ exceptions in the compile flags), it still needs to known the potential mechanism for stack unwinding (this is what the personality variable means).

The reason why the template apps from Cocos2d+Box2d don't have this problem is that they possess some .mm files; as a result the c++ compiler is used to perform the final link, which pulls in the c++ library automatically.

gcc linker errors on fedora: undefined reference

Don't do this:

gcc -std=c++0x Main.cpp

Do this instead:

g++ -std=c++0x Main.cpp

Or do this instead:

gcc Main.cpp -lstdc++

The bottom line is: make sure that you either use "g++" or "-lstdc++" at the link stage. You can use either front end during the compile stage.



Related Topics



Leave a reply



Submit