5

I am getting the following error when building my code:

C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error      
MSB6006: "cmd.exe" exited with code 3.
Done executing task "CustomBuild" -- FAILED. (TaskId:40)

How do I resolve this?

Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
golu kashyap
  • 213
  • 2
  • 5
  • 10
  • we need to see more of your custombuild code. From the very little that you've shown us, it look like you're trying execute a custom build on some file (header, text file, protobuf... etc??) but have the incorrect path to the file hence why cmd.exe exits. – g19fanatic Jan 21 '15 at 12:50
  • Use View > Output so you can see the error message. – Hans Passant May 14 '23 at 10:19

3 Answers3

10

Open your .vcxproj file as a .xml file (so with Notepad++ or equivalent.)

You should be able to search the file for the "CustomBuild" tag.

Something in the task defined by that tag is failing.

You can test what it is by trying to run the commands in that task from the command line in the same directory as the .vcxproj.

If you can't solve your problem from there I'd recommend adding the "CustomBuild" task to the question so we can better help you.

Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
2

If it is a project where vs2015 installed the QT plugin to write QT:

Click on QT -> Qt Project Settings -> Properties -> Version -> above to change to Default QtVersion -> right-click on the project to regenerate

jimas13
  • 597
  • 5
  • 19
大宝贝
  • 21
  • 1
0

I met the same error, then I tried a lot of things, but nothing worked. Finally I removed the project, created the new one, and added the previous files to it. The problem was solved. I compared the old and new projects,found that the old project's [Qt Project Settings] and other related functions were not available, while the new project was normal.

Lili
  • 1