错误MSB6006:“ CL.exe”用代码2退出 [英] error MSB6006: "CL.exe" exited with code 2

查看:88
本文介绍了错误MSB6006:“ CL.exe”用代码2退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Visual C ++编写,并且在我编译时发生此错误:

I'm writing with visual c++ and when I compile this error occures:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error MSB6006: "CL.exe" terminato con il codice 2.

有人知道为什么吗?

感谢

推荐答案

您实际上可以看到正确的错误消息,而不是Microsoft的任意错误代码。但是由于错误列表总是在出现错误时被强制显示,因此并不是很明显。选项卡错误列表旁边是另一个选项卡输出,其中显示了原始错误输出。我不确定自2019年以来该版本是否在所有版本中都存在,但是在较旧的版本中总会有一些相似之处。

You can actually see the proper error messages instead of Microsoft's arbitrary error codes. But since the error list is always forcibly made visible when there are errors, it isn't quite so obvious. Next to the tab Error List is another tab Output, which shows the raw error output. I'm not sure if that tab exists in all versions since I'm using 2019, but there might be something very similar in older versions anyways. Differently named perhaps, or an entirely separate window instead of grouped with Error List.

的情况下,名称可能不同,或者是一个完全独立的窗口,而不是与错误列表分组。 href = https://stackoverflow.com/a/56828676/8132412>此处的另一个答案,确切的标签会显示:错误C4700:使用了未初始化的局部变量'm'

In the case of another answerer here that exact tab would've shown: error C4700: uninitialized local variable 'm' used

这将使他免于挖掘所有代码的麻烦。 =]

Which would have saved him from having to dig through all his code. =]

如果您忘记了需要返回值的函数的返回值,则会看到: error C4716:'foo':must返回值

And if you forget a return value for a function that requires it, you'll see: error C4716: 'foo': must return a value

这篇关于错误MSB6006:“ CL.exe”用代码2退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆