My educated guess would be the order of included headers, i.e. include winsock2.h
first (with first meaning before windows.h
), or define WIN32_LEAN_AND_MEAN before including windows.h
, which prevents windows.h from including winsock v1.
#include <winsock2.h>
#include <windows.h>
-or-
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…