我有一个使用Qt5.5.1的应用程序,它在Visual Studio 2013中生成良好。我试图让它与Visual Studio 2015中的Qt5.6 Beta一起工作,但我得到了新的编译器警告:无法在VS2015中禁用编译器警告
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vcruntime_typeinfo.h(41): error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vcruntime_typeinfo.h(41): warning C4623: '__std_type_info_data': default constructor was implicitly defined as deleted
我使用警告级别4(/ W4),并警告视为错误(/ WX)。但是当转到属性页面并使用C/C++ - >高级 - >禁用特定警告来禁用警告4623我看到同样的问题。如果我将警告等级更改为3(/ W3)或更高,则会发生同样的情况。
为什么Visual Studio在自己的代码上给我一个警告,为什么我不能禁用它?
Perhaops http://stackoverflow.com/questions/4193476/is-using-pragma-warning-push-pop-the-right-way-to-temporarily- alter-warning-lev会帮助 –
不是。我的代码中没有包含vcruntime_typeinfo.h,其中一个答案表示可以使用禁用特定警告而不是编译指示。 – parsley72
您提到的文件必须直接或间接包含在内。在编译的有问题的文件的开头使用编译指示。 –