c++ - 如何让Mingw编译器兼容Qt 4.8.5

标签 c++ qt mingw mingw32

当我想在 Qt 4.8.5 和 Mingw 编译器下编译程序时遇到问题

我尝试了许多版本的 Mingw(v 4.5.0 到 4.8),但总是遇到相同的错误

c:\Qt\4.8.5\lib\libqtmaind.a(qtmain_win.o):-1: In function `WinMain@16':
c:\iwmake\build_mingw_opensource\src\winmain\qtmain_win.cpp:93: erreur : undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain\qtmain_win.cpp:135: erreur : undefined reference to `_Unwind_Resume'
c:\Qt\4.8.5\lib\libqtmaind.a(qtmain_win.o):-1: In function `ZN7QVectorIPcE7reallocEii':
c:\iwmake\build_mingw_opensource\src\corelib\tools\qvector.h:512: erreur : undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\corelib\tools\qvector.h:513: erreur : undefined reference to `_Unwind_Resume'
qtmain_win.cpp:-1: erreur : undefined reference to `__gxx_personality_v0'
:-1: erreur : collect2: ld returned 1 exit status

最佳答案

确保您使用的不是 mingw,而是 mingw-w64。 mingw 现在或多或少已经死了。

我的建议是使用最新Qt SDK中打包的mingw-w64。除了 mingw 构建之外,还有一个 Qt-builds 项目。这是由 mingw-builds 团队运营的。他们有适当的脚本来构建所有 Qt、QtCreator 等。

在这里你可以找到它们(开发分支):

https://github.com/Alexpux/Qt-builds/tree/develop

话虽如此,您也可以通过 mingw 获取今天的最新内容:

https://code.google.com/p/psi-dev/downloads/detail?name=MinGW-gcc-4.4.0-2.7z

关于c++ - 如何让Mingw编译器兼容Qt 4.8.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18760720/

相关文章:

c++ - 如何将 QPixmap 设置为空

html - 带有富文本的 QML 文本元素 : How to adjust vertical position of an <img>

c++ - Qt:如何在 Mac 的应用程序菜单中添加自定义菜单项?

c++ - 请问支持 MingW32 的免费分析器好吗?

c++ - MFC 串行通信

c++ - 用 C++ 解析

c++ - pimpl 是否与匿名命名空间兼容?

c++ - 为什么它不能在 VS Express 2013 中编译,尽管它在 MinGW 中编译?

带有嵌入式函数调用的 C++ 输出评估顺序

c++ - C++ 总分