Boost logo

Boost :

From: Andreas Willich (andreas_willich_at_[hidden])
Date: 2005-12-18 14:57:30


Hi Boost- Devs

I noticed a problem with the use of asio together with the test program exec
monitor. If you include the prg_exec_monitor.hpp before the asio.hpp the
boost.test lib includes winsock.h. In the next step asio includes the
winsock2.h. The result is that there are many redefinition errors like
these:

d:\librarys\boost\include\boost-1_33\boost\asio\detail\socket_types.hpp(41)
: warning C4005: 'FD_SETSIZE' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(51) :
see previous definition of 'FD_SETSIZE'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(112) : error
C2011: 'fd_set' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(54) :
see declaration of 'fd_set'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(147) :
warning C4005: 'FD_SET' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(88) :
see previous definition of 'FD_SET'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(156) : error
C2011: 'timeval' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(97) :
see declaration of 'timeval'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(212) : error
C2011: 'hostent' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(153) :
see declaration of 'hostent'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(225) : error
C2011: 'netent' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(166) :
see declaration of 'netent'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(232) : error
C2011: 'servent' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(173) :
see declaration of 'servent'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(244) : error
C2011: 'protoent' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(185) :
see declaration of 'protoent'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(400) : error
C2011: 'sockaddr_in' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(321) :
see declaration of 'sockaddr_in'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(410) : error
C2011: 'WSAData' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(331) :
see declaration of 'WSAData'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(470) :
warning C4005: 'SO_DONTLINGER' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(411) :
see previous definition of 'SO_DONTLINGER'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(527) :
warning C4005: 'AF_IPX' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(469) :
see previous definition of 'AF_IPX'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(555) :
warning C4005: 'AF_MAX' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(488) :
see previous definition of 'AF_MAX'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(561) : error
C2011: 'sockaddr' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(494) :
see declaration of 'sockaddr'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(601) : error
C2011: 'sockproto' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(503) :
see declaration of 'sockproto'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(640) : error
C2011: 'linger' : 'struct' type redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(540) :
see declaration of 'linger'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(653) :
warning C4005: 'SOMAXCONN' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(553) :
see previous definition of 'SOMAXCONN'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(679) :
warning C4005: 'FD_READ' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(571) :
see previous definition of 'FD_READ'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(682) :
warning C4005: 'FD_WRITE' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(572) :
see previous definition of 'FD_WRITE'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(685) :
warning C4005: 'FD_OOB' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(573) :
see previous definition of 'FD_OOB'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(688) :
warning C4005: 'FD_ACCEPT' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(574) :
see previous definition of 'FD_ACCEPT'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(691) :
warning C4005: 'FD_CONNECT' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(575) :
see previous definition of 'FD_CONNECT'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(694) :
warning C4005: 'FD_CLOSE' : macro redefinition
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(576) :
see previous definition of 'FD_CLOSE'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1626) : error
C2375: 'accept' : redefinition; different linkage
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(744) :
see declaration of 'accept'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1647) : error
C2375: 'bind' : redefinition; different linkage
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(749) :
see declaration of 'bind'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1666) : error
C2375: 'closesocket' : redefinition; different linkage
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(754) :
see declaration of 'closesocket'
d:\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1685) : error
C2375: 'connect' : redefinition; different linkage
        d:\microsoft visual studio 8\vc\platformsdk\include\winsock.h(756) :
see declaration of 'connect'
...

Perhaps someone can add a notice about this situation to the docs.

Andreas


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk