C++ 在哪里可以获得正确的gdi+;c++;VS21015的包装器?
我有windows工具包\8.1\include\um\gdiplusheaders.h等-但我们正在从VS2013升级到VS2015,我遇到了无数编译器错误,例如:C++ 在哪里可以获得正确的gdi+;c++;VS21015的包装器?,c++,winapi,visual-studio-2015,gdi+,C++,Winapi,Visual Studio 2015,Gdi+,我有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 file
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'
现在,我可以使用W/WV标志,但是我猜我需要一个更新版本的Windows SDK,它包含了GDI+C++包装的当前版本。 然而,我发现谷歌没有这样的结果
更新: 我发现这种混乱的情况越来越多了。 我清理了Gdiplus.h中的警告,确保在包含Gdiplus.h之前,I#prama warning(disable:4458),但我得到了: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其他部分的完全不相关的垃圾名称冲突,因为可能某个地方隐藏了全局。。。伙计!这太傻了(看来装运的SDK在/W4处确实充满了警告。 在调用各种SDK头之前,必须返回到/W3或覆盖各种警告
仅供参考-VS2013能够使用/W4编译相同的SDK。因此可能会有更多的警告,或者它们捕获更多的违规行为。我看到在程序文件(x86)下还有其他windows工具包-但不清楚如何选择一个编译正确的…?。如果确实是使用更新的SDK的问题,那么应该这样做。该死-我假设它也是这样-并找到了该接口-但我唯一的选择是“8.1”,尽管我在程序文件(x86)下看到了其他SDK(如果您安装了Visual Studio 2015,它应该与Windows 10 SDK一起提供。我不知道您是否必须在安装程序中选择特定功能,让它也安装GDI+标头(尽管我认为SDK是全有或全无的交易)。但是,如果它没有出现在IDE的界面中,则可能是出了问题。安装程序并不是世界上最健壮的安装程序。同时,使用Project>Properties>C/C++>General>Warning level=Level3如果您想对此进行否决以说明原因,这会有所帮助。如果您有更好的答案,请随意添加,嗯?我也不知道为什么;我可以确认几乎所有的Windows API头都会出现这种情况,即使是VS2013。我认为这与/W4和/Tc的结合有关,但这个问题证明了另一个原因……我很确定以前也有人问过类似的问题。