My project uses windows.h in which winsock.h is used, and I need to include boost:assio which uses winsock2. So I get many errors that says Winsock.h already included. I can
#ifdef BOOST_OS_WINDOWS #define _WIN32_WINNT 0x0501 #if _WIN32_WINNT <= 0x0501 #define BOOST_ASIO_DISABLE_IOCP #define BOOST_ASIO_ENABLE_CANCELIO #endif #endif