VS2015是否会自动包含Windows SDK标头文件,而在VS2017中不包含Windows SDK标头文件?
我有一个最初在 VS2015 中开发的 C++ 库,它使用 Windows SDK 8.1 内 Winsock2 的 SOCKET。解决方案文件是从 cmake 文件生成的,并且构建得非常好。 我使用相同的 cmake 文件在 VS2017 中再次创建解决方案。但是,除非添加 #include
我检查了项目属性,它们看起来相同并且都使用 Windows SDK 8.1。那么VS2015和VS2017有什么区别呢? VS2015自动包含windows SDK头文件但VS2017中不包含?
I have a C++ library originally developed in VS2015 which uses SOCKET from Winsock2 inside Windows SDK 8.1. The solution file is generated from a cmake file, and it builds perfectly fine.
I use the same cmake file to create the solution again in VS2017. However, I can not compile it unless I add #include <WinSock2.h> at the file where SOCKET is being used. It looks like it's not picking up the definition of SOCKET unless I explicitly include the WinSock2.h file. And I don't need to do that in VS2015.
I checked the project properties and they look the same and are both using Windows SDK 8.1. So what is the difference here with VS2015 and VS2017? Does VS2015 automatically include windows SDK header files but not in VS2017?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论