Boost::asio winsock and winsock 2 compatibility issue

后端 未结 5 575
难免孤独
难免孤独 2020-12-28 16:57

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

5条回答
  •  一个人的身影
    2020-12-28 17:21

    An other workarround I used is to concentrate all asio dependent code in an XXX.hpp file and include it on the top of each windows implementing XXX.cpp file where you use its objects.

    this method place the include asio above any other include windows.h and work arround the problem.

提交回复
热议问题