问题
windows.h和winsock2.h存在有类型重定义,往往体现在头文件包含winsock2.h和windows.h时出现编译错误:
error C2011: “sockaddr_in”:“struct”类型重定义
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(442,5): error C2143: 语法错误: 缺少“}”(在“常数”的前面)
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(442,5): error C2059: 语法错误:“常数”
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(496,1): error C2143: 语法错误: 缺少“;”(在“}”的前面)
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(496,10): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(496,20): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
2>D:\Windows Kits\10\Include\10.0.22000.0\shared\ws2def.h(577,1): warning C4005: “IN_CLASSA”: 宏重定义
2>D:\Windows