Undefined reference to _Unwind_Resume and __gxx_personality_v0

后端 未结 3 2051
忘掉有多难
忘掉有多难 2020-12-03 14:32

I\'m trying to use the JsonCpp library. I\'m on Windows, using MinGW and CodeBlocks.

When I include anything from the json headers, my linker implodes and gives out

相关标签:
3条回答
  • 2020-12-03 15:13

    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 ).

    0 讨论(0)
  • 2020-12-03 15:18

    I encountered that same problem attempting to use g++ -g -std=c++17 ... . I removed that option and, once I had removed use of a C++17 feature, it compiled, linked and ran.

    0 讨论(0)
  • 2020-12-03 15:24

    For those coming to this from google (like i did), the real cause of the undefined references to _Unwind_Resume and __gxx_personality_v0 is "using a gcc that uses a different stack unwinding method than dwarf2" [1]

    In my case it was attempting to link code compiled with GCC 4.9 upwards with a library compiled with GCC 4.8 or below. The solution is to recompile the library with the same compiler you're building with.

    0 讨论(0)
提交回复
热议问题