更新时间:2023-10-23 10:19:58
__gxx_personality_v0
用于C ++库的异常处理. MinGW可以在x86上支持几个不同的异常模型:sjlj(setjmp
/longjmp
)或DWARF(DW2).据我所知,将使用哪种模型被编译到编译器中-不能通过命令行选项进行选择.
__gxx_personality_v0
is used in the exception handling of the C++ library. MinGW can support a couple different exception models on the x86: sjlj (setjmp
/longjmp
) or DWARF (DW2). As far as I know, which model will be used is compiled into the compiler - it's not something that can be selected with a command line option.
sjlj异常模型将链接到__gxx_personality_sj0
,DW2异常模型将链接到__gxx_personality_v0
.似乎您的编译器正在为dw2异常模型构建,但是在运行时,它会找到使用sjlj模型构建的libstdc++-6.dll
.查看您的系统上是否具有libstdc++-6.dll
的多个版本,并查看是否将另一个版本复制到与您的程序相同的目录下可以解决此问题.
The sjlj exception model will link to __gxx_personality_sj0
, the DW2 exception model links to __gxx_personality_v0
. It seems like your compiler is building for the dw2 exception model, but at runtime it's finding a libstdc++-6.dll
that was built with the sjlj model. See if you have multiple versions of libstdc++-6.dll
on youR system, and see if copying another one to the same directory as your program fixes the problem.
您可以使用nm libstdc++-6.dll | grep personality
来查看DLL正在使用哪个异常个性".
You can use nm libstdc++-6.dll | grep personality
to see which exception 'personality' the DLL is using.