2014-04-13 50 views
0

我在尝试使用QTCreater构建应用程序时出现问题。QTCreator Not Building(Windows x64,MinGW)

这是错误我得到:

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 `[email protected]': 
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 4.8.5,我从Qt libraries 4.8.5 for Windows (minGW 4.4, 317 MB)

下载,我使用MinGW的,我得到了从安装Codeblocks MinGW

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

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

回答

0

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

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

+0

好的,那么我该怎么做呢?我安装了qtcreator-3.0.1并安装了Qt 4.8.5库。我在哪里可以获得并安装适用于QT的MiniGW-w64? – Leo

+0

@Leo:Qt Creator安装目录中的某个地方是一个“mingw”文件夹。只要设置你的Qt Creator“工具链”(在settings:Build&Run下)指向那个目录中的“g ++。exe”,你就应该设置好了,一定要重建一切。 – rubenvb

+0

谢谢,我设法让它工作 - 我在我的Qt目录中找不到minGW文件夹,我不得不从https://docs.google.com/file/d/0B4D8x6CJEmtuczdiQklwMEs4RUU/edit 下载v4.4谢谢!它现在工作。 – Leo