error MSB6006: “cmd.exe” exited with code 1

前端 未结 10 1327
生来不讨喜
生来不讨喜 2020-12-30 21:09

When I\'m trying to build my VC++ code using 2010 I\'m getting the error message

> C:\\Program Files\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targ

相关标签:
10条回答
  • 2020-12-30 21:23

    Simple and better solution : %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.sln I make a bat file like this %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe D:\GESTION-SOMECOPA\GestionCommercial\GestionCommercial.sln pause

    Then I can see all errors and correct them. Because when you change the folder name (without spaces as seen above) you will have another problems. Visual Studio 2015 works fine after this.

    0 讨论(0)
  • 2020-12-30 21:25

    error MSB6006: "cmd.exe" exited with code -Solved

    I also face this problem . In my case it is due to output exe already running .I solved my problem simply close the application instance before building.

    0 讨论(0)
  • 2020-12-30 21:28

    Another solution could be, that you deleted a file from your Project by just removing it in your file system, instead of removing it within your project.

    0 讨论(0)
  • 2020-12-30 21:31

    I solved this. double click this error leads to behavior.

    1. open .vcxproj file of your project
    2. search for tag
    3. check carefully what's going inside this tag, the path is right? difference between debug and release, and fix it
    4. clean and rebuild

    for my case. a miss match of debug and release mod kills my afternoon.

              <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
    </Command>
          <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
    </Command>
          <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
          <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
          <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy ..\vc2005\%(Filename)%(Extension) ..\..\cvd\
    </Command>
          <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy %(Filename)%(Extension) ..\..\cvd\
    </Command>
          <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
          <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\cvd\%(Filename)%(Extension);%(Outputs)</Outputs>
        </CustomBuild>
    
    0 讨论(0)
  • 2020-12-30 21:31

    I also faced similar issue.

    My source path had one directory with 'space' (D:/source 2012). I resolved this by removing the space (D:/source2012).

    0 讨论(0)
  • 2020-12-30 21:33

    When working with a version control system where all files are read only until checked out (like Perforce), the problem may be that you accidentally submitted into this version control system one of the VS files (like filters, for example) and the file thus cannot be overridden during build.

    Just go to your working directory and check that none of VS solution related files and none of temporary created files (like all moc_ and ui_ prefixed files in QT, for example) is read only.

    0 讨论(0)
提交回复
热议问题