执行构建步骤'Make'时构建项目时出错

时间:2012-05-03 04:23:56

标签: c++ qt makefile qt-creator

我刚刚在我的电脑上安装了Qt SDK 1.2.1。我创建了一个新项目作为测试:

File > New File or Project... > Other Project > Plain C++ Project

我选择了这些构建设置:

qt creator build settings

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 Creator之前运行Qt 4.8.1 for Desktop (MSVC 2008)批处理脚本并检查Projects > Build Settings > Build Environment > Using System Environment > Clear System Environment但没有成功。

安装Qt SDK 1.2.1之后

我的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 Professional(Service Pack 2)。 Qt SDK 1.2.1附带的Qt Creator版本是2.4.1。

1 个答案:

答案 0 :(得分:1)

您的系统上似乎未安装cl,或者需要将PATH环境变量添加到cl.exe环境变量中。尝试在C:\Program Files\Microsoft Visual Studio [version]\中的某处找到PATH二进制文件,并将包含该二进制文件的目录添加到{{1}}。