如何使用Microsoft Visual Studio编译Qt

时间:2013-12-03 09:05:27

标签: visual-studio-2010 qt compilation

我创建了一个Qt程序,我可以使用Visual Studio编译它而没有问题(使用外接程序)但是当我尝试使用编码编译它时我遇到了问题。问题是

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
Done Building Project "C:\foo.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\foo.vcxproj" (default target) (1) ->
(CustomBuild target) ->
  C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]

    0 Warning(s)
    1 Error(s)

我如何解决问题,请帮助我......

错误:

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 03.12.2013 11:35:49.
Project "C:\foo.vcxproj" on node 1 (default targets).
InitializeBuildStatus:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
Done Building Project "C:\foo.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\foo.vcxproj" (default target) (1) ->
(CustomBuild target) -> 
  C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.14

1 个答案:

答案 0 :(得分:2)

此消息:

The system cannot find the path specified.
当前上下文中的

告诉我,构建程序找不到moc.exeuic.exe。您需要通过执行以下操作将C:\Qt\5.1.1\msvc2012_64\bin或包含qmake.exemoc.exeuic.exe和其他Qt程序的任何目录添加到PATH:

set PATH=C:\Qt\5.1.1\msvc2012_64\bin;%PATH%