[asio] error using cvs version with vc71... multiple definitions
I am have probably screwed up something simple... I can't seem to compile file including boost/asio.hpp from CVS. I get redefinition errors... apparently Winsock.h, winsock2.h, mswsock.h and some other files seem to be fighting. Any clue what I did wrong or how to fix? Last update was in last couple days. Thanks Andy
Hi Andrew, Andrew Schweitzer wrote:
I am have probably screwed up something simple... I can't seem to compile file including boost/asio.hpp from CVS. I get redefinition errors... apparently Winsock.h, winsock2.h, mswsock.h and some other files seem to be fighting.
Any clue what I did wrong or how to fix?
Last update was in last couple days.
Can you please post the compiler command line and the error you are seeing, thanks! Cheers, Chris
Christopher Kohlhoff wrote:
Can you please post the compiler command line and the error you are seeing, thanks!
------ Build started: Project: DHCP, Configuration: Debug Win32 ------ Compiling... DHCP.cpp Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately Assuming _WIN32_WINNT=0x0500 (i.e. Windows 2000 target) e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_types.hpp(59) : warning C4005: 'FD_SETSIZE' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(51) : see previous definition of 'FD_SETSIZE' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(109) : error C2011: 'fd_set' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(54) : see declaration of 'fd_set' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(144) : warning C4005: 'FD_SET' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(88) : see previous definition of 'FD_SET' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(153) : error C2011: 'timeval' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(97) : see declaration of 'timeval' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(209) : error C2011: 'hostent' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(153) : see declaration of 'hostent' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(222) : error C2011: 'netent' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(166) : see declaration of 'netent' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(229) : error C2011: 'servent' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(173) : see declaration of 'servent' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(241) : error C2011: 'protoent' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(185) : see declaration of 'protoent' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(397) : error C2011: 'sockaddr_in' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(321) : see declaration of 'sockaddr_in' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(407) : error C2011: 'WSAData' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(331) : see declaration of 'WSAData' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(467) : warning C4005: 'SO_DONTLINGER' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(411) : see previous definition of 'SO_DONTLINGER' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(524) : warning C4005: 'AF_IPX' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(469) : see previous definition of 'AF_IPX' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(552) : warning C4005: 'AF_MAX' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(488) : see previous definition of 'AF_MAX' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(558) : error C2011: 'sockaddr' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(494) : see declaration of 'sockaddr' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(598) : error C2011: 'sockproto' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(503) : see declaration of 'sockproto' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(637) : error C2011: 'linger' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(540) : see declaration of 'linger' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(650) : warning C4005: 'SOMAXCONN' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(553) : see previous definition of 'SOMAXCONN' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(675) : warning C4005: 'FD_READ' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(571) : see previous definition of 'FD_READ' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(678) : warning C4005: 'FD_WRITE' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(572) : see previous definition of 'FD_WRITE' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(681) : warning C4005: 'FD_OOB' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(573) : see previous definition of 'FD_OOB' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(684) : warning C4005: 'FD_ACCEPT' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(574) : see previous definition of 'FD_ACCEPT' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(687) : warning C4005: 'FD_CONNECT' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(575) : see previous definition of 'FD_CONNECT' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(690) : warning C4005: 'FD_CLOSE' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(576) : see previous definition of 'FD_CLOSE' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1622) : error C2375: 'accept' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(744) : see declaration of 'accept' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1643) : error C2375: 'bind' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(749) : see declaration of 'bind' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1662) : error C2375: 'closesocket' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(754) : see declaration of 'closesocket' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1681) : error C2375: 'connect' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(756) : see declaration of 'connect' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1702) : error C2375: 'ioctlsocket' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(761) : see declaration of 'ioctlsocket' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1723) : error C2375: 'getpeername' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(766) : see declaration of 'getpeername' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1744) : error C2375: 'getsockname' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(771) : see declaration of 'getsockname' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1767) : error C2375: 'getsockopt' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(776) : see declaration of 'getsockopt' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1788) : error C2375: 'htonl' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(783) : see declaration of 'htonl' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1805) : error C2375: 'htons' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(785) : see declaration of 'htons' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1822) : error C2375: 'inet_addr' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(787) : see declaration of 'inet_addr' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1839) : error C2375: 'inet_ntoa' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(789) : see declaration of 'inet_ntoa' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1857) : error C2375: 'listen' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(791) : see declaration of 'listen' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1875) : error C2375: 'ntohl' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(795) : see declaration of 'ntohl' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1892) : error C2375: 'ntohs' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(797) : see declaration of 'ntohs' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1912) : error C2375: 'recv' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(799) : see declaration of 'recv' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1937) : error C2375: 'recvfrom' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(805) : see declaration of 'recvfrom' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1963) : error C2375: 'select' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(813) : see declaration of 'select' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1987) : error C2375: 'send' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(820) : see declaration of 'send' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2012) : error C2375: 'sendto' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(826) : see declaration of 'sendto' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2038) : error C2375: 'setsockopt' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(834) : see declaration of 'setsockopt' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2060) : error C2375: 'shutdown' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(841) : see declaration of 'shutdown' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2080) : error C2375: 'socket' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(845) : see declaration of 'socket' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2103) : error C2375: 'gethostbyaddr' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(852) : see declaration of 'gethostbyaddr' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2122) : error C2375: 'gethostbyname' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(857) : see declaration of 'gethostbyname' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2140) : error C2375: 'gethostname' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(859) : see declaration of 'gethostname' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2159) : error C2375: 'getservbyport' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(863) : see declaration of 'getservbyport' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2178) : error C2375: 'getservbyname' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(867) : see declaration of 'getservbyname' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2196) : error C2375: 'getprotobynumber' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(871) : see declaration of 'getprotobynumber' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2213) : error C2375: 'getprotobyname' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(873) : see declaration of 'getprotobyname' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2233) : error C2375: 'WSAStartup' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(877) : see declaration of 'WSAStartup' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2251) : error C2375: 'WSACleanup' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(881) : see declaration of 'WSACleanup' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2268) : error C2375: 'WSASetLastError' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(883) : see declaration of 'WSASetLastError' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2285) : error C2375: 'WSAGetLastError' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(885) : see declaration of 'WSAGetLastError' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2302) : error C2375: 'WSAIsBlocking' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(887) : see declaration of 'WSAIsBlocking' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2319) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(889) : see declaration of 'WSAUnhookBlockingHook' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2336) : error C2375: 'WSASetBlockingHook' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(891) : see declaration of 'WSASetBlockingHook' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2353) : error C2375: 'WSACancelBlockingCall' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(893) : see declaration of 'WSACancelBlockingCall' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2375) : error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(895) : see declaration of 'WSAAsyncGetServByName' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2402) : error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(903) : see declaration of 'WSAAsyncGetServByPort' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2428) : error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(911) : see declaration of 'WSAAsyncGetProtoByName' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2453) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(918) : see declaration of 'WSAAsyncGetProtoByNumber' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2478) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(925) : see declaration of 'WSAAsyncGetHostByName' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2505) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(932) : see declaration of 'WSAAsyncGetHostByAddr' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2528) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(941) : see declaration of 'WSACancelAsyncRequest' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2548) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(943) : see declaration of 'WSAAsyncSelect' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(28) : error C2011: 'ip_mreq' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(372) : see declaration of 'ip_mreq' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(71) : warning C4005: 'IP_TOS' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(361) : see previous definition of 'IP_TOS' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(72) : warning C4005: 'IP_TTL' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(360) : see previous definition of 'IP_TTL' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(73) : warning C4005: 'IP_MULTICAST_IF' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(355) : see previous definition of 'IP_MULTICAST_IF' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(74) : warning C4005: 'IP_MULTICAST_TTL' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(356) : see previous definition of 'IP_MULTICAST_TTL' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(75) : warning C4005: 'IP_MULTICAST_LOOP' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(357) : see previous definition of 'IP_MULTICAST_LOOP' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(76) : warning C4005: 'IP_ADD_MEMBERSHIP' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(358) : see previous definition of 'IP_ADD_MEMBERSHIP' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(77) : warning C4005: 'IP_DROP_MEMBERSHIP' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(359) : see previous definition of 'IP_DROP_MEMBERSHIP' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WS2tcpip.h(78) : warning C4005: 'IP_DONTFRAGMENT' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(362) : see previous definition of 'IP_DONTFRAGMENT' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(128) : error C2440: '=' : cannot convert from 'unsigned long (__stdcall *)(const char *)' to 'DWORD' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(128) : error C2440: '=' : cannot convert from 'unsigned long (__stdcall *)(const char *)' to 'DWORD' This conversion requires a reinterpret_cast, a C-style cast or function-style cast d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(128) : error C3861: 'inet_addr': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(232) : error C2440: '=' : cannot convert from 'hostent *(__stdcall *)(const char *)' to 'hostent *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(232) : error C2440: '=' : cannot convert from 'hostent *(__stdcall *)(const char *)' to 'hostent *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(232) : error C3861: 'gethostbyname': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(262) : error C3861: 'WSAGetLastError': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(262) : error C2450: switch expression of type 'int (__stdcall *)(void)' is illegal Integral expression required d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(544) : error C2440: '=' : cannot convert from 'u_short (__stdcall *)(u_short)' to 'WORD' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(544) : error C2440: '=' : cannot convert from 'u_short (__stdcall *)(u_short)' to 'WORD' This conversion requires a reinterpret_cast, a C-style cast or function-style cast d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(544) : error C3861: 'htons': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(555) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(const char *,const char *)' to 'servent *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(555) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(const char *,const char *)' to 'servent *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(555) : error C3861: 'getservbyname': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(562) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(const char *,const char *)' to 'servent *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(562) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(const char *,const char *)' to 'servent *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(562) : error C3861: 'getservbyname': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(597) : error C2440: '=' : cannot convert from 'u_long (__stdcall *)(u_long)' to 'DWORD' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(597) : error C2440: '=' : cannot convert from 'u_long (__stdcall *)(u_long)' to 'DWORD' This conversion requires a reinterpret_cast, a C-style cast or function-style cast d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(595) : error C3861: 'htonl': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(616) : error C3861: 'inet_ntoa': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(736) : error C3861: 'ntohs': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(742) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(int,const char *)' to 'servent *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(742) : error C2440: '=' : cannot convert from 'servent *(__stdcall *)(int,const char *)' to 'servent *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(741) : error C3861: 'getservbyport': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(751) : error C3861: 'ntohs': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(772) : error C2440: '=' : cannot convert from 'char *(__stdcall *)(in_addr)' to 'char *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(772) : error C2440: '=' : cannot convert from 'char *(__stdcall *)(in_addr)' to 'char *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(772) : error C3861: 'inet_ntoa': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(779) : error C2440: '=' : cannot convert from 'hostent *(__stdcall *)(const char *,int,int)' to 'hostent *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(779) : error C2440: '=' : cannot convert from 'hostent *(__stdcall *)(const char *,int,int)' to 'hostent *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(777) : error C3861: 'gethostbyaddr': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(793) : error C3861: 'WSAGetLastError': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(793) : error C2450: switch expression of type 'int (__stdcall *)(void)' is illegal Integral expression required d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(802) : error C2440: '=' : cannot convert from 'char *(__stdcall *)(in_addr)' to 'char *' d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(802) : error C2440: '=' : cannot convert from 'char *(__stdcall *)(in_addr)' to 'char *' There is no context in which this conversion is possible d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WSPiApi.h(802) : error C3861: 'inet_ntoa': identifier not found, even with argument-dependent lookup d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSock.h(85) : error C2011: '_TRANSMIT_FILE_BUFFERS' : 'struct' type redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(955) : see declaration of '_TRANSMIT_FILE_BUFFERS' e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(43) : error C3861: 'WSAGetLastError': identifier not found, even with argument-dependent lookup e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(53) : error C3861: 'WSASetLastError': identifier not found, even with argument-dependent lookup e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(939) : error C3861: 'htons': identifier not found, even with argument-dependent lookup e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(939) : error C2440: 'initializing' : cannot convert from 'u_short (__stdcall *)(u_short)' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(966) : error C3861: 'getservbyname': identifier not found, even with argument-dependent lookup e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\socket_ops.hpp(966) : fatal error C1003: error count exceeds 100; stopping compilation Build log was saved at "file://e:\nan\C++\Sandbox\Dhcp\Debug\BuildLog.htm" DHCP - 102 error(s), 20 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped
Andrew Schweitzer wrote:
Compiling... DHCP.cpp Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately Assuming _WIN32_WINNT=0x0500 (i.e. Windows 2000 target) e:\nan\boost\source_control\cvs\boost\boost\boost\asio\detail\ socket_types.hpp(59) : warning C4005: 'FD_SETSIZE' : macro redefinition d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(51) : see previous definition of 'FD_SETSIZE'
I suspect it's due to winsock.h being included before the asio header files. What are the headers you include from DHCP.cpp, in order?
Christopher Kohlhoff wrote:
I suspect it's due to winsock.h being included before the asio header files. What are the headers you include from DHCP.cpp, in order?
#include "windows.h"
#include <iostream>
#include <iterator>
#include <fstream>
#include
Andrew Schweitzer wrote:
#include "windows.h" #include <iostream> #include <iterator> #include <fstream> #include
Try:
#include
: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information
Nice. BTW, yesterday I committed a bunch of fixes and other changes into CVS, so you may want to update (and hope it doesn't break anything :) Cheers, Chris
hm... all three of those give internal compiler errors. ...trying update... Christopher Kohlhoff wrote:
Andrew Schweitzer wrote:
#include "windows.h" #include <iostream> #include <iterator> #include <fstream> #include
Try:
#include
#include "windows.h" ... or:
#include "winsock2.h" #include "windows.h" ...
or:
#define WIN32_LEAN_AND_MEAN #include "windows.h" ...
: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information
Nice.
BTW, yesterday I committed a bunch of fixes and other changes into CVS, so you may want to update (and hope it doesn't break anything :)
Cheers, Chris
Christopher Kohlhoff wrote:
BTW, yesterday I committed a bunch of fixes and other changes into CVS, so you may want to update (and hope it doesn't break anything :)
ok, updating didn't seem to work, I got pretty much same results (internal compiler errors), except for my first case which intentionally complained that winsock hadn't been included. Building from 0.3.7 zip downloaded from web works. If you have other things to try I will, but I can probably work with 0.3.7 for now. Thanks for your help. Andy
Andrew Schweitzer wrote:
If you have other things to try I will, but I can probably work with 0.3.7 for now.
Can you post a small, standalone program that shows the internal compiler error? It might just be a list of #includes, by the sound of it. BTW, have you applied the service pack for vc7.1? (I haven't.) Cheers, Chris
It's browse info! If I turn on browse info, the attached project gets an internal compiler error. If I turn it off, it's gone. Doesn't seem to happen with 0.3.7. I don't have the vc7.1 service pack. PS, rename attached file to .zip, unzip; command line option for browser is /FR"Debug/" - in all cases debug builds.
Andrew Schweitzer wrote:
It's browse info!
If I turn on browse info, the attached project gets an internal compiler error. If I turn it off, it's gone. Doesn't seem to happen with 0.3.7.
I don't have the vc7.1 service pack.
PS, rename attached file to .zip, unzip; command line option for browser is /FR"Debug/" - in all cases debug builds.
Yep, I can also reproduce the problem by adding the /FR option to my builds. I'm not sure what I'm supposed to do about this though. It looks like it's a function call being made using ADL that's causing it to die. I tried different ways of arranging the code but it makes no difference. I'll see if I can apply the vc7.1 service pack today and whether that makes any difference. Cheers, Chris
Christopher Kohlhoff wrote:
I'm not sure what I'm supposed to do about this though. Me either. I suppose it should be possible to isolate it more closely by comparing 0.3.7. I suppose with a simple reproducible case someone could call MS tech support. I can live without it.
I'll see if I can apply the vc7.1 service pack today and whether that makes any difference.
I'm trying that too.
Cheers, Chris
Andrew Schweitzer wrote:
Christopher Kohlhoff wrote:
I'll see if I can apply the vc7.1 service pack today and whether that makes any difference.
Same problem occurs with service pack.
A pity. At least it works ok with vc8. I'm pretty sure I know what the post-0.3.7 feature is that triggers it, but it's not something I am willing to remove :) I will try boiling it down to the smallest possible program that shows up the problem to see if that gives any clues on how to work around it. Cheers, Chris
Christopher Kohlhoff wrote:
A pity. At least it works ok with vc8. I'm pretty sure I know what the post-0.3.7 feature is that triggers it, but it's not something I am willing to remove :) I will try boiling it down to the smallest possible program that shows up the problem to see if that gives any clues on how to work around it.
Sounds good. For me it's not a big deal. I'll either live with it or move to vc8. Andy
Hi Andrew, Andrew Schweitzer wrote:
Christopher Kohlhoff wrote:
A pity. At least it works ok with vc8. I'm pretty sure I know what the post-0.3.7 feature is that triggers it, but it's not something I am willing to remove :) I will try boiling it down to the smallest possible program that shows up the problem to see if that gives any clues on how to work around it.
Sounds good. For me it's not a big deal. I'll either live with it or move to vc8.
I think I've just fixed this problem on cvs HEAD. Can you let me know if it also fixes it for you? If you just want to patch your copy, make this change: http://boost.cvs.sourceforge.net/boost/boost/boost/asio/detail/strand_service.hpp?r1=1.3&r2=1.4 Cheers, Chris
Christopher Kohlhoff wrote:
I think I've just fixed this problem on cvs HEAD.
http://boost.cvs.sourceforge.net/boost/boost/boost/asio/detail/strand_service.hpp?r1=1.3&r2=1.4
Built! Verified compiler error with attached project, when browse on. Commented out line. Builds fine. I haven't actually tested the code, I don't have any strands at the moment. Andy
Cheers, Chris
participants (2)
-
Andrew Schweitzer
-
Christopher Kohlhoff