"WinSock.h has already been included" : problem with asio and VC++2010

Hi! I use a boost asio library in my program. When I compile with Visual C++ obtain this error: [...]\boost_1_45_0\boost\asio\detail\socket_types.hpp(22): fatal error C1189: #error : WinSock.h has already been included How can I fix this error? -- View this message in context: http://boost.2283326.n4.nabble.com/WinSock-h-has-already-been-included-probl... Sent from the Boost - Users mailing list archive at Nabble.com.

Hi! Hello,
I use a boost asio library in my program. When I compile with Visual C++ obtain this error:
[...]\boost_1_45_0\boost\asio\detail\socket_types.hpp(22): fatal error C1189: #error : WinSock.h has already been included
How can I fix this error?
Try to include asio before including any other Windows-Headers, or use WinSock2.h instead of WinSock. Best Regards, michi7x7

If you use "Windows.h" library, set "#define WIN32_LEAN_AND_MEAN" in "stdafx.h" or a suitable place to avoid the duplication. from Hee-young -- View this message in context: http://boost.2283326.n4.nabble.com/WinSock-h-has-already-been-included-probl... Sent from the Boost - Users mailing list archive at Nabble.com.

I solved the problem, thanks! -- View this message in context: http://boost.2283326.n4.nabble.com/WinSock-h-has-already-been-included-probl... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (3)
-
Claude
-
Hee-young Kim
-
michi7x7