Hi,
My project uses boost 1.34.1 libraries for asio and also includes
windows.h (which in turn includes winsock.h). This results in a macro
redefinition error for FD_SETSIZE and then goes on to spew a
bucketload of related errors.
The easiest way to reproduce this is to have a simple main.cpp with just:
#include
#include
int main() { return 0; }
Any ideas on what I'm doing wrong? Or what I could try? I've tried
defining WIN32_LEAN_AND_MEAN, IPPROTO_V6 in the makefile, but to no
avail.
I'm using VC 8 on a windows XP.
========================
My comand line looks like this:
C:\perforce\some\path\>make main.o
-- Compile main.cpp...
c:/perforce/toolchain/win32/winsdk-6.1.6000/VC/bin/cl.exe -nologo
-Fdc:/perforce/some/path
somelib.pdb -Gm -EHsc -c -Zi -TP -GR -D_WIN32 -D_USRDLL
-D_WIN32_WINNT -DWINVER=0x0600 -D_WINDLL -D_MBCS -W3 -D_CRT_NO
NSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -DUSERLEVEL -MDd -Od
-D_DEBUG -RTC1
-I"C:\perforce\toolchain\win32\boost-1.34.1\include"
-Ic:/perforce/toolchain/win32/winsdk-6.1.6000/Include
-Ic:/perforce/toolchain/win32/winsdk-6.1.6000/VC/include
-Ic:/perforce/toolchain/win32/winsdk-6.1.6000/VC/PlatformSDK/Include
And the error message looks like:
C:\perforce\toolchain\win32\boost-1.34.1\include\boost/asio/detail/socket_types.hpp(44)
: warning C4005: 'FD_SETSIZE' : macro redefinition
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\winsock.h(65)
: see previous definition of 'FD_SETSIZE'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(91) :
warning C4005: 'AF_IPX' : macro redefinition
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\winsock.h(460)
: see previous definition of 'AF_IPX'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(116) :
warning C4005: 'AF_MAX' : macro redefinition
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\winsock.h(479)
: see previous definition of 'AF_MAX'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(163) :
warning C4005: 'SO_DONTLINGER' : macro redefinition
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\winsock.h(402)
: see previous definition of 'SO_DONTLINGER'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(206) :
error C2011: 'sockaddr' : 'struct' type redefinition
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\winsock.h(485)
: see declaration of 'sockaddr'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(384) :
error C2143: syntax error : missing '}' before 'constant'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(437) :
error C2143: syntax error : missing ';' before '}'
c:\perforce\toolchain\win32\winsdk-6.1.6000\Include\ws2def.h(437)
:error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
========================