winsock2.h(112) : error C2011: 'fd_set' : 'struct' type redefinition

ε祈祈猫儿з 提交于 2020-02-07 00:51:44

winsock2.h(112) : error C2011: 'fd_set' : 'struct' type redefinition

 

<windows.h>中已经包含了早期版本的<winsock.h> (windows socket 1.1)

参照<stdafx.h>中的做法,在#include <windows.h> 前添加

#define  WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN   // Exclude rarely-used stuff from Windows headers

#include <windows.h>
#include <winsock2.h>

#include <ws2tcpip.h>
#pragma comment(lib,"ws2_32.lib")

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!