QTCreator Not Building(Windows x64,MinGW)

时间:2014-04-13 10:50:05

标签: c++ qt qt4 mingw qt-creator

当我尝试使用QTCreater构建应用程序时,我遇到了问题。

这是我得到的错误:

QT编译输出:

12:40:01: Running steps for project untitled2...
12:40:01: Starting: "C:\Qt\4.8.5\bin\qmake.exe" C:\Users\user\Desktop\untitled2\untitled2.pro -r -spec win32-g++ "CONFIG+=declarative_debug"
12:40:01: The process "C:\Qt\4.8.5\bin\qmake.exe" exited normally.
12:40:01: Starting: "C:\MinGW-back\bin\mingw32-make.exe" 
C:/MinGW-back/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/user/Desktop/build-untitled2-Unnamed-Debug'
c:\Qt\4.8.5\bin\uic.exe ..\untitled2\mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\main.o ..\untitled2\main.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\mainwindow.o ..\untitled2\mainwindow.cpp
C:\Qt\4.8.5\bin\moc.exe -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\untitled2\mainwindow.h -o debug\moc_mainwindow.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
g++ -mthreads -Wl,-subsystem,windows -o debug\untitled2.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o  -L"c:\Qt\4.8.5\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4 
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o): In function `WinMain@16':
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:93: undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o): In function `ZN7QVectorIPcE7reallocEii':
c:\iwmake\build_mingw_opensource\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:512: undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:513: undefined reference to `_Unwind_Resume'
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o):qtmain_win.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug\untitled2.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Users/user/Desktop/build-untitled2-Unnamed-Debug'
mingw32-make: *** [debug] Error 2
12:40:07: The process "C:\MinGW-back\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled2 (kit: Unnamed)
When executing step 'Make'
12:40:07: Elapsed time: 00:07.

我使用的是从Qt libraries 4.8.5 for Windows (minGW 4.4, 317 MB)

下载的QT 4.8.5

我使用的是安装Codeblocks MinGW的MinGW

请帮忙。它为QTCreator for Windows设置了这样的痛苦。

修改 解决方案是使用MinGW 4.4,我在这里找到:https://docs.google.com/file/d/0B4D8x6CJEmtuczdiQklwMEs4RUU/edit

1 个答案:

答案 0 :(得分:0)

您必须使用Qt附带的MinGW-w64工具链链接到Qt库。或者使用你的工具链重建Qt,对于4.8而言,这并不像5.x那样痛苦。

您正在链接的编译器版本之间的ABI不同,并且无法使这些版本兼容。

相关问题