简体   繁体   English

为什么VS2013中的#warning会产生错误?

[英]Why does #warning in VS2013 is producing an error?

I am using Visual Studio 2013, with Resharper 8.2. 我正在使用Visual Studio 2013和Resharper 8.2。 I must be missing something here. 我一定在这里想念什么。 I have added #warning to the code and it failed the build. 我在代码中添加了#warning ,但构建失败。

在此处输入图片说明

Question is why? 问题是为什么? isn't that's what #error is for? 那不是#error目的吗?

I suspect you have set the "treat warnings as errors" flag in your project build properties. 我怀疑您在项目构建属性中设置了“将警告视为错误”标志。

You can either remove that flag, or set it to only treat specific warnings as errors. 您可以删除该标志,也可以将其设置为仅将特定警告视为错误。

在项目的Build属性中是否设置了“将警告视为错误”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM