citi
citi

Reputation: 31

How to compile Qt with Microsoft Visual Studio

I created a Qt programme, I can compile it without problem manuelly with Visual Studio (using Add-In) but when I try to compile it with coding I have a problem. The problem is

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)

How can I solve the problem, please help me…

Error:

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

Upvotes: 1

Views: 3335

Answers (1)

rubenvb
rubenvb

Reputation: 76519

This message:

The system cannot find the path specified.

in the current context tells me that the build program can't find moc.exe and uic.exe. You need to add C:\Qt\5.1.1\msvc2012_64\bin or whatever directory contains qmake.exe, moc.exe, uic.exe and other Qt programs to PATH by doing:

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

Upvotes: 3

Related Questions