在 Windows 上使用 g++ 编译 C++ 后出现 __gxx_personality_v0 错误

Posted

技术标签:

【中文标题】在 Windows 上使用 g++ 编译 C++ 后出现 __gxx_personality_v0 错误【英文标题】:Getting __gxx_personality_v0 error after compiling C++ with g++ on Windows 【发布时间】:2016-01-24 20:29:09 【问题描述】:

标题。

编译成功后:

#include <iostream>

class test

    public:
    int Render() return 4;
;

int main()

    test b;
    std::cout << b.Render() << std::endl;   
    return 0;

使用这个命令:

g++ .\src\test.cpp -lstdc++

生成的可执行文件会产生错误消息(如我正在翻译的那样解释):

Entry point for procedure __gxx_personality_v0 in library [path of executable] not found.

有什么建议吗?

【问题讨论】:

也许添加 -lgcc_s 会有所帮助? @nsilent22 不,没有帮助。 ***.com/questions/18668003/… ? 天哪,这行得通!谢谢! 【参考方案1】:

答案:将 libstdc++6.dll 从 C:\mingw\bin 复制到可执行文件的文件夹中。

【讨论】:

以上是关于在 Windows 上使用 g++ 编译 C++ 后出现 __gxx_personality_v0 错误的主要内容,如果未能解决你的问题,请参考以下文章