E2238 Multiple declaration for 'fd_set' 报错

Build
  [C++ Error] winsock2.h(109): E2238 Multiple declaration for 'fd_set'
  [C++ Error] winsock.h(54): E2344 Earlier declaration of 'fd_set'
  [C++ Error] winsock2.h(112): E2146 Need an identifier to declare
  [C++ Error] winsock2.h(153): E2238 Multiple declaration for 'timeval'
  [C++ Error] winsock.h(97): E2344 Earlier declaration of 'timeval'
  [C++ Error] winsock2.h(209): E2238 Multiple declaration for 'hostent'
  [C++ Error] winsock.h(153): E2344 Earlier declaration of 'hostent'
  [C++ Error] winsock2.h(222): E2238 Multiple declaration for 'netent'
  [C++ Error] winsock.h(166): E2344 Earlier declaration of 'netent'
  [C++ Error] winsock2.h(229): E2238 Multiple declaration for 'servent'
  [C++ Error] winsock.h(173): E2344 Earlier declaration of 'servent'
  [C++ Error] winsock2.h(241): E2238 Multiple declaration for 'protoent'
  [C++ Error] winsock.h(185): E2344 Earlier declaration of 'protoent'
  [C++ Error] winsock2.h(327): E2238 Multiple declaration for 'in_addr'
  [C++ Error] winsock.h(269): E2344 Earlier declaration of 'in_addr'
  [C++ Error] winsock2.h(385): E2238 Multiple declaration for 'sockaddr_in'
  [C++ Error] winsock.h(319): E2344 Earlier declaration of 'sockaddr_in'
  [C++ Error] winsock2.h(395): E2238 Multiple declaration for 'WSAData'
  [C++ Error] winsock.h(329): E2344 Earlier declaration of 'WSAData'
  [C++ Error] winsock2.h(411): E2146 Need an identifier to declare
  [C++ Error] winsock2.h(546): E2238 Multiple declaration for 'sockaddr'
  [C++ Error] winsock.h(492): E2344 Earlier declaration of 'sockaddr'
  [C++ Error] winsock2.h(586): E2238 Multiple declaration for 'sockproto'
  [C++ Error] winsock.h(501): E2344 Earlier declaration of 'sockproto'
  [C++ Error] winsock2.h(625): E2238 Multiple declaration for 'linger'
  [C++ Error] winsock2.h(625): E2228 Too many error or warning messages

这个错误的解决办法是

在.cpp文件最上面加上#include <vcl.h>

你可能感兴趣的:(E2238 Multiple declaration for 'fd_set' 报错)