禁用 C++项目级别的警告?
我知道您可以使用#pragma 禁用特定文件中的警告,但我想“关闭”整个 VC++ 2008 项目的某个警告。
我找到了一个选项配置属性->C/C++->高级->禁用特定警告
但是当我输入数字警告代码并重新编译有问题的.cpp文件时,警告仍然生成了。
I know you can use a #pragma
to disable a warning in a specific file, but I want to "turn off" a certain warning for a whole VC++ 2008 project.
I found an option Configuration Properties->C/C++->Advanced->Disable Specific Warnings
but when I entered the numeric warning code and re-compiled the .cpp file in question, the warning was still generated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的项目包含其他项目或使用其他项目中的对象,请确保在发生警告的项目上添加警告禁用。这应该总是有效。
If your project includes other projects or uses objects from another project, make sure you add the warning disable on the project where the warning occurs. This should always work.
尝试使用预编译头并在那里放置警告禁用代码。它对我有用,警告 C4005。
Try to use precompiled header and put warnings disable code there. It worked for me with warning C4005.