我刚刚在我的 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 4.8.1 for Desktop (MSVC 2008)
在启动 Qt Creator 之前运行批处理脚本并检查Projects > Build Settings > Build Environment > Using System Environment > Clear System Environment
没有成功。
PATH
安装 Qt SDK 1.2.1 后我的变量:
%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 Professional (Service Pack 2)。Qt SDK 1.2.1 附带的 Qt Creator 版本是 2.4.1。