error MSB6006: "cmd.exe" exited with code - c++

I am building driver for my USB device. While building using msvisual studio10 I am getting following two errors:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5):
error MSB6006: "cmd.exe" exited with code
and
C:/boost32/include/boost-1_48\boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp(34):
error C2766: explicit specialization;
'boost::numeric::numeric_cast_traits<char,char>' has already been
defined 2>
C:/boost32/include/boost-1_48\boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp(18)
: see previous definition of 'numeric_cast_traits<char,char,void>'
Help me out in getting rid of these two errors which are hindering tyhe building process of my project.

I realize the question is quite old, but some people seem to be interested in resolution.
I believe, the boost compilation problem might be described here. The problem is with boost version 1.48, exactly what you seem to have.
Then, to fix it try using newer boost version or just take the problematic header from newer boost version.
Now, the cmd.exe error is most likely caused by this compilation failure.

Related

Visual Studio 2019 "C1001 internal compiler error" only in Release

I'm getting a C1001 error while attempting to build in Visual Studio 2019 Version 16.7.2. This is a C++ project that has previously built fine until a change set I am attempting to build today.
The exact error is as follows: (with project specific path redacted)
1>d:\work\[...](82): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'd:\agent\_work\3\s\src\vctools\compiler\utc\src\p2\main.c', line 187)
Notes below:
The error only happens in Release. Debug builds and runs.
If I turn off all optimizations in Release the error goes away.
The location where the error occurs seems to be unrelated to recent changes I have made to the project i.e. VS is reporting the error in a translation unit that had been building without problem until unrelated changes in another TU were made.
The location where the error occurs seems to not actually be problematic in the sense that if I comment out the implementation of the function there and just return a default value from the function so that the program is syntactically correct, the error occurs in the next the function in the same file.
Turning off Whole Program Optimization and Link Time Code Generation does not fix the problem.
SUGGESTIONS
Please:
Update your post with exact error text (if available)
Post your question to https://developercommunity.visualstudio.com/ as well
See if any of these links are applicable:
https://developercommunity.visualstudio.com/content/problem/710576/visual-studio-2019-1622-fatal-error-c1001-in-32-bi.html
https://social.msdn.microsoft.com/Forums/vstudio/en-US/165975b4-35e9-4b40-9524-e656a4e2f359/fatal-error-c1001-an-internal-error-has-occurred-in-the-compiler?forum=visualstudiogeneral
https://developercommunity.visualstudio.com/content/problem/664162/ice-on-valid-code-after-upgrading-to-1620.html
One way to notify Microsoft Support like this:
MSVS > Help > Send Feedback > Report a Problem
Here is a complete list of MSVS support options: https://visualstudio.microsoft.com/vs/support/
Update:
Thank you for copying/pasting the exact error message:
1>d:\work\[...](82): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'd:\agent\_work\3\s\src\vctools\compiler\utc\src\p2\main.c', line 187)
This is the MSVS file causing the error C1001: vctools\compiler\utc\src\p2\main.c
This is an existing Microsoft trouble report:
https://developercommunity.visualstudio.com/content/problem/210332/c1001-internal-error-compiler-file-fddvctoolscompi.html
Hi Roger,
Thanks for reporting the bug, and including an excellently
self-contained repro, so quickly. I've investigated and this seems to
be the same issue as
https://developercommunity.visualstudio.com/content/problem/209359/ice-with-fpfast-in-156-and-msvc-daily-1413263051-p.html.
I'm closing this as a duplicate just so that people can collect
context and work-around advice in the same location, and when the
other bug is marked fixed, you can assume that this one is too.
Thanks again,
Aaron Gorenstein
Software Engineer II
Searching for this error message/source module, I also found this: https://stackoverflow.com/a/63435683/421195
Please post back if either of these work for you!

MSB6006 error when code used to work fine in visual studio C++

I'm getting the 'MSB6006 "CL.exe" exited with code 2' error. The problem is that my code used to work fine. The issue came when I tried to add another library from xtensor (the xtensor-blas) and I couldn't get it to work correctly. I just erased everything I tried to add and get a clean run, but it now fails every time.
While trying to compile the Error List says things like "C1083 fatal error: cannot open source file: 'files that I have deleted'". Whenever I stop the build, it then only gives the MSB6006 error.
It has become extremely frustrating since my code is identical to what it used to be and now doesn't work.
Is there any way around this?
Answer given by Quentin: There may still be references in the vcxproj file created by Visual Studio. Delete those references and it should work.

Visual studio doesn't compile

Last friday everything worked perfect. But on Monday I got this error message in Visual Studio.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error MSB6006: "CL.exe" exited with code -1.
Doesn't matter what I do that I always get same error. I've repaired VS , uninstalled VS , changed the SDK , the plugins.. everything. If I execute cl.exe manually I dont get any error.
Have found this thread:
http://connect.microsoft.com/VisualStudio/feedback/details/724154/error-msb6006-cl-exe-exited-with-code-1073741819
I thought It was written by me! but there's no solution inside it.
Thanks.
The important parts of this message are:
CL.EXE : This means the error occurs during a compilation step. It's not a pre-build step.
Code -1 : This means the error is not the same as the one you linked (which was -1073741819).
The first thing to do is figuring out when it fails. What file is being compiled? Create the default "Hello, World" project and compile that. If it works: problem is input dependent. If not: what's the problematic input? Can you compile a single file of your project? If you can't find any, pick one and turn on "pre-processing only". Does it at least pass the pre-processor phase? Turn on LTCG. (link-time code generation, CL won't create x86 code). Does it work now?

Build error referring to yvals.h in a cantata++ test project

I am testing c++ source codes using the tool cantata++. I created a project, built it and encounter the following error message.
error I9282: the global scope has no "_invalid_parameter" C:\LegacyApp\VisualStudio2005\VC\include\yvals.h 167
I find this error wierd, because yvals.h is not really a file in my source codes. What does this error message imply?
You'll find that yvals.h is probably included by one of the many system header files the Microsoft compiler includes, and you are only seeing it in the error message because the Cantata++ instrumenter is finding a problem with it. My guess would be that there is some problem with the settings in either Cantata++, your Visual Studio project or a mismatch between the two meaning they are not using the same settings.
In order to help diagnose the problem it would help to know a few things about the setup you have, and the code you are building when you get the error.
As Joachim Wuttke said, I would suggest you contact the Cantata Technical Support team directly if you are still having problems with this issue. They will be able to provide you with further information to help solve the problem.

Very Mysterious/Random C++ WDK STL 7 Error: iosfwd(202): error C2144: syntax error

I have the following trivial file named Temp.cpp:
#include <string>
int main() { return 0; }
and I'm trying to compile it with the following command-line in the Windows XP Free Build Environment, using WDK 7.1:
cl.exe /Iinc\api\crt\stl70 /Iinc\crt C:\Temp.cpp
and I'm getting really random errors like:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.207 for 80x86
C:\WinDDK\7600.16385.1\inc\api\crt\stl70\iosfwd(202) :
error C2144: syntax error : 'int' should be preceded by ';'
The error goes away if I use stl60 instead of stl70, but that doesn't solve the problem.
What's the cause of the problem?
Update: I tried uninstalling and installing the WDK again, but nothing changed. :(
Update 2: Okay, apparently the error is screaming out at the header file itself: _SCL_INSECURE_DEPRECATE is the cause. Does anybody know how to turn it off correctly? (If I just comment out the lines, I get a ton more errors regarding a bunch of other macros.)
Found the answer myself, through modifying the headers and guess'n'checking:
I need to have _STL70_ defined.
Which cl.exe are you picking up? If your path happens to have an older (VC6) compiler before the WDK one, you'd expect these errors. VC6 can't compile the STL as shipped with VC7
apparently the error is screaming out at the header file itself: _SCL_INSECURE_DEPRECATE is the cause. Does anybody know how to turn it off correctly?
If you're having problems with _SCL_INSECURE_DEPRECATE, try setting:
/D_SCL_SECURE_NO_DEPRECATE
But given the error message you're seeing it sounds like you're the compiling headers with a a compiler that's older than the headers support (so this might not get you very far anyway).