Windows ws2def & winsock2 redefinition errors
jordanbaucke opened this issue · 1 comments
jordanbaucke commented
I am getting a number of errors when attempting to build in WIndows, all appear to be emanating from winsock2.h
and ws2def.h
and are redefinition; different linkage
, is there a flag I should be passing in Windows build to avoid this?
As an example:
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(457): note: see previous definition of 'AF_IPX'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(147): warning C4005: 'AF_MAX': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(476): note: see previous definition of 'AF_MAX'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(185): warning C4005: 'SO_DONTLINGER': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(235): error C2011: 'sockaddr': 'struct' type redefinition
2> C:\Qt_5.6.2_32\5.6\msvc2015\include\QtNetwork/qhostaddress.h(42): note: see declaration of 'sockaddr'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(437): error C2059: syntax error: 'constant'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(437): error C3805: 'constant': unexpected token, expected either '}' or a ','
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(572): warning C4005: 'IN_CLASSA': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(284): note: see previous definition of 'IN_CLASSA'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(578): warning C4005: 'IN_CLASSB': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(290): note: see previous definition of 'IN_CLASSB'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(584): warning C4005: 'IN_CLASSC': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(296): note: see previous definition of 'IN_CLASSC'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(595): warning C4005: 'INADDR_ANY': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(301): note: see previous definition of 'INADDR_ANY'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(597): warning C4005: 'INADDR_BROADCAST': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(303): note: see previous definition of 'INADDR_BROADCAST'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\ws2def.h(633): error C2011: 'sockaddr_in': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1011): note: see declaration of 'sockaddr_in'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(136): error C2011: 'fd_set': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1019): note: see declaration of 'fd_set'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(156): warning C4005: 'FD_CLR': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(94): note: see previous definition of 'FD_CLR'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(171): warning C4005: 'FD_SET': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(99): note: see previous definition of 'FD_SET'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(180): error C2011: 'timeval': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1035): note: see declaration of 'timeval'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(236): error C2011: 'hostent': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1023): note: see declaration of 'hostent'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(249): error C2011: 'netent': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(177): note: see declaration of 'netent'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(256): error C2011: 'servent': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1027): note: see declaration of 'servent'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(268): error C2011: 'protoent': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1031): note: see declaration of 'protoent'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(364): error C2011: 'WSAData': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(319): note: see declaration of 'WSAData'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(462): error C2011: 'sockproto': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(491): note: see declaration of 'sockproto'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(504): error C2011: 'linger': 'struct' type redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(1015): note: see declaration of 'linger'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(517): warning C4005: 'SOMAXCONN': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(541): note: see previous definition of 'SOMAXCONN'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(551): warning C4005: 'FD_READ': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(559): note: see previous definition of 'FD_READ'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(554): warning C4005: 'FD_WRITE': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(560): note: see previous definition of 'FD_WRITE'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(557): warning C4005: 'FD_OOB': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(561): note: see previous definition of 'FD_OOB'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(560): warning C4005: 'FD_ACCEPT': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(562): note: see previous definition of 'FD_ACCEPT'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(563): warning C4005: 'FD_CONNECT': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(563): note: see previous definition of 'FD_CONNECT'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(566): warning C4005: 'FD_CLOSE': macro redefinition
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(564): note: see previous definition of 'FD_CLOSE'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1624): error C2375: 'accept': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(739): note: see declaration of 'accept'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1646): error C2375: 'bind': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(744): note: see declaration of 'bind'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1667): error C2375: 'closesocket': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(749): note: see declaration of 'closesocket'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1684): error C2375: 'connect': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(751): note: see declaration of 'connect'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1705): error C2375: 'ioctlsocket': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(756): note: see declaration of 'ioctlsocket'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1726): error C2375: 'getpeername': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(761): note: see declaration of 'getpeername'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1747): error C2375: 'getsockname': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(766): note: see declaration of 'getsockname'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1768): error C2375: 'getsockopt': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(771): note: see declaration of 'getsockopt'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1793): error C2375: 'htonl': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(778): note: see declaration of 'htonl'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1810): error C2375: 'htons': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(780): note: see declaration of 'htons'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1828): error C2375: 'inet_addr': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(782): note: see declaration of 'inet_addr'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1846): error C2375: 'inet_ntoa': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(784): note: see declaration of 'inet_ntoa'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1946): error C2375: 'listen': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(786): note: see declaration of 'listen'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1965): error C2375: 'ntohl': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(790): note: see declaration of 'ntohl'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1982): error C2375: 'ntohs': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(792): note: see declaration of 'ntohs'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(1999): error C2375: 'recv': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(794): note: see declaration of 'recv'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2022): error C2375: 'recvfrom': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(800): note: see declaration of 'recvfrom'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2049): error C2375: 'select': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(808): note: see declaration of 'select'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2074): error C2375: 'send': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(815): note: see declaration of 'send'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2097): error C2375: 'sendto': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(821): note: see declaration of 'sendto'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2124): error C2375: 'setsockopt': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(829): note: see declaration of 'setsockopt'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2149): error C2375: 'shutdown': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(836): note: see declaration of 'shutdown'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2169): error C2375: 'socket': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(840): note: see declaration of 'socket'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2194): error C2375: 'gethostbyaddr': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(847): note: see declaration of 'gethostbyaddr'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2216): error C2375: 'gethostbyname': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(852): note: see declaration of 'gethostbyname'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2233): error C2375: 'gethostname': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(854): note: see declaration of 'gethostname'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2273): error C2375: 'getservbyport': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(858): note: see declaration of 'getservbyport'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2292): error C2375: 'getservbyname': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(862): note: see declaration of 'getservbyname'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2311): error C2375: 'getprotobynumber': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(866): note: see declaration of 'getprotobynumber'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2328): error C2375: 'getprotobyname': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(868): note: see declaration of 'getprotobyname'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2348): error C2375: 'WSAStartup': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(872): note: see declaration of 'WSAStartup'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2368): error C2375: 'WSACleanup': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(876): note: see declaration of 'WSACleanup'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2385): error C2375: 'WSASetLastError': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(878): note: see declaration of 'WSASetLastError'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2402): error C2375: 'WSAGetLastError': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(880): note: see declaration of 'WSAGetLastError'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2423): error C2375: 'WSAIsBlocking': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(882): note: see declaration of 'WSAIsBlocking'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2441): error C2375: 'WSAUnhookBlockingHook': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(884): note: see declaration of 'WSAUnhookBlockingHook'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2459): error C2375: 'WSASetBlockingHook': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(886): note: see declaration of 'WSASetBlockingHook'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2477): error C2375: 'WSACancelBlockingCall': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(888): note: see declaration of 'WSACancelBlockingCall'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2495): error C2375: 'WSAAsyncGetServByName': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(890): note: see declaration of 'WSAAsyncGetServByName'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2523): error C2375: 'WSAAsyncGetServByPort': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(898): note: see declaration of 'WSAAsyncGetServByPort'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2551): error C2375: 'WSAAsyncGetProtoByName': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(906): note: see declaration of 'WSAAsyncGetProtoByName'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2577): error C2375: 'WSAAsyncGetProtoByNumber': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(913): note: see declaration of 'WSAAsyncGetProtoByNumber'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2603): error C2375: 'WSAAsyncGetHostByName': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(920): note: see declaration of 'WSAAsyncGetHostByName'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2629): error C2375: 'WSAAsyncGetHostByAddr': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(927): note: see declaration of 'WSAAsyncGetHostByAddr'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2659): error C2375: 'WSACancelAsyncRequest': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(936): note: see declaration of 'WSACancelAsyncRequest'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock2.h(2677): error C2375: 'WSAAsyncSelect': redefinition; different linkage
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\winsock.h(938): note: see declaration of 'WSAAsyncSelect'
dnascimento commented
What was the cause? I'm having the same problem in another application