我剛剛在我的PC上安裝了Qt SDK 1.2.1。我創建了一個新的項目作爲一個試驗:構建項目時執行構建步驟'生成'時出錯
File > New File or Project... > Other Project > Plain C++ Project
我選擇了這些構建設置:
Qt Creator中生成此.pro文件:
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += main.cpp
這main.cpp文件:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
構建失敗:
13:39:35: Running build steps for project test...
13:39:35: Starting: "C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe" clean
Could Not Find C:\Dev\Projects\Qt\test\debug\main.obj
del debug\main.obj
del debug\test.intermediate.manifest debug\test.exp debug\test.ilk vc*.pdb vc*.idb
Could Not Find C:\Dev\Projects\Qt\test\debug\test.intermediate.manifest
Could Not Find C:\Dev\Projects\Qt\test\vc*.pdb
Could Not Find C:\Dev\Projects\Qt\test\test.intermediate.manifest
Could Not Find C:\Dev\Projects\Qt\test\test.exp
Could Not Find C:\Dev\Projects\Qt\test\test.ilk
Could Not Find C:\Dev\Projects\Qt\test\vc*.pdb
c:\dev\qt\qtsdk\desktop\qt\4.8.1\msvc2008\bin\qmake.exe -spec ..\..\..\Qt\QtSDK\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008 CONFIG+=declarative_debug -o Makefile test.pro
C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug clean
C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe -f Makefile.Release clean
Could Not Find C:\Dev\Projects\Qt\test\release\main.obj
Could Not Find C:\Dev\Projects\Qt\test\release\test.intermediate.manifest
del release\main.obj
del release\test.intermediate.manifest release\test.exp
del ".\test.intermediate.manifest"
del test.exp
del test.ilk
del vc*.pdb
del vc*.idb
Could Not Find C:\Dev\Projects\Qt\test\vc*.idb
jom 1.0.8 - empower your cores
13:39:36: The process "C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe" exited normally.
13:39:36: Configuration unchanged, skipping qmake step.
13:39:36: Starting: "C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe"
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -I"..\..\..\Qt\QtSDK\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\DOCUME~1\Mitch!\LOCALS~1\Temp\main.obj.5936.16.jom
C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
'cl' is not recognized as an internal or external command,
operable program or batch file.
jom: C:\Dev\Projects\Qt\test\Makefile.Debug [debug\main.obj] Error 1
jom 1.0.8 - empower your cores
jom: C:\Dev\Projects\Qt\test\Makefile [debug] Error 2
13:39:36: The process "C:\Dev\Qt\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project test (target: Desktop)
When executing build step 'Make'
我試着開始Qt創建者和檢查Projects > Build Settings > Build Environment > Using System Environment > Clear System Environment
沒有成功之前運行Qt 4.8.1 for Desktop (MSVC 2008)
批處理腳本。安裝的Qt SDK 1.2後
我PATH
變量:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\jEdit;C:\Program Files\TortoiseSVN\bin;C:\Program Files\doxygen\bin;C:\Program Files\NVIDIA Corporation\Cg\bin;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1.0
我的電腦運行的是Windows XP專業版(Service Pack 2)。 Qt SDK 1.2.1附帶的Qt Creator版本是2.4.1。
一個很好的和有效的問題。但是,這似乎是一個安裝問題,您可能會在Qt開發人員網絡中獲得更好的幫助。有一個[專門用於安裝的線程](http://qt-project.org/forums/viewforum/14/)。 – Anthony
已經創建了一個錯誤報告:https://bugreports.qt-project.org/browse/QTCREATORBUG-7973 – Mitch
正如Sebastien在錯誤報告的評論中指出的那樣,解決方法是從Visual Studio運行創建者2008命令提示符。 – Mitch