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")
来源:CSDN
作者:zing2000
链接:https://blog.csdn.net/zing2008/article/details/104200939