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

前端 未结 10 1328
生来不讨喜
生来不讨喜 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:34

    Actually Just delete the build ( clean it ) , then restart the compiler , build it again problem solved .

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

    I had the same problem today, while I was upgrading some VC6 project to VC2012.

    In my case, it was because some of the operation in Custom Built Steps failed. In project properties, go to Custom Build Step, you can see there maybe some something in command line edit box. Open a windows prompt and paste the command to it. Run, check if there is something wrong and fix it.

    If there is no command line in the project property Custom Built Step, maybe you should check properties of every single file of the project.

    If the command line has some macro, replace it with an actual value.

    Or you can echo the command in VS output window:

    • cd %(somedir)%
    • echo %(somedir)%

    You won't miss it this way.

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

    Navigate from Error List Tab to the Visual Studios Output folder by one of the following:

    • Select tab Output in standard VS view at the bottom
    • Click in Menubar View > Output or Ctrl+Alt+O

    where Show output from <build> should be selected.

    You can find out more by analyzing the output logs.


    In my case it was an error in the Cmake step, see below. It could be in any build step, as described in the other answers.

    > -- Build Type is debug 
    > CMake Error in CMakeLists.txt:
    >     A logical block opening on the line
    >     <path_to_file:line_number>    
    >     is not closed.
    
    0 讨论(0)
  • 2020-12-30 21:47

    For the sake of future readers. My problem was that I was specifying an incompatible openssl library to build my program through CMAKE. Projects were generated but build started failing with this error without any other useful information or error. Verbose cmake/compilation logs didn't help either.

    My take away lesson is that cross check the incompatibilities in case your program has dependencies on the any other third party library.

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