我有windows套件\ 8.1 \ include \ um \ gdiplusheaders.h&等等 - 但是我们正在从VS2013升级到VS2015而且我遇到了无穷无尽的编译错误,例如:
1>c:\program files (x86)\windows kits\8.1\include\um\gdiplusheaders.h(695): error C2220: warning treated as error - no 'object' file generated
1>c:\program files (x86)\windows kits\8.1\include\um\gdiplusheaders.h(695): warning C4458: declaration of 'nativeCap' hides class member
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusheaders.h(695): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusheaders.h(710): note: see declaration of 'Gdiplus::CustomLineCap::nativeCap'
1>c:\program files (x86)\windows kits\8.1\include\um\gdiplusimageattributes.h(364): warning C4458: declaration of 'nativeImageAttr' hides class member
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusimageattributes.h(364): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusimageattributes.h(378): note: see declaration of 'Gdiplus::ImageAttributes::nativeImageAttr'
1>c:\program files (x86)\windows kits\8.1\include\um\gdiplusmatrix.h(296): warning C4458: declaration of 'nativeMatrix' hides class member
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusmatrix.h(296): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1> c:\program files (x86)\windows kits\8.1\include\um\gdiplusmatrix.h(310): note: see declaration of 'Gdiplus::Matrix::nativeMatrix'
现在,似乎我可以使用指示的/ Wv标志 - 但我的猜测是我需要一个包含当前版本的GDI + C ++包装器的Windows SDK的更新版本。
但是,我发现Google没有这样的结果。
更新: 我发现这种混乱只是越来越多。 我在#include'ing gdiplus.h之前确保我#prama警告(禁用:4458)清理了Gdiplus.h中的警告,但我得到了:
1>c:\users\steve\vault\cimex cad-cam\17.0\mfc toolbox\cstring utilities.h(441): warning C4459: declaration of 'chQuote' hides global declaration
1> c:\users\steve\vault\cimex cad-cam\17.0\mfc toolbox\cstring utilities.h(441): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
从我自己的代码中,VS2015正在考虑将自由函数参数与c:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ atlmfc \ include \ statreg.h冲突 - 它定义了一个全局的命名空间ATL!
真是一团糟!这真的是标准机构想要的吗?!这太疯狂了!现在每个变量或参数都必须避免与来自Windows或MFC / ATL的其他部分的完全不相关的垃圾名称冲突,因为某些地方可能隐藏了一个全局......伙计!这是DUMB。 :(答案 0 :(得分:0)
看来发货的SDK在/ W4确实充满了警告。 在调用各种SDK标头之前,必须先退回/ W3或覆盖各种警告。
仅供参考 - VS2013能够使用/ W4编译相同的SDK。所以可能会有更多的警告,或者他们会发现更多的违规行为。