由于boost库在1.7以后的版本移除了get_io_service。
所以对代码作如下修改:
//保证兼容性
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
boost::asio::io_service& get_io_service(){
return GET_IO_SERVICE(acceptor_);
}
然后将原本使用acceptor_.get_io_service()函数的地方替换为GET_IO_SERVICE(acceptor_)
参考:https://github.com/AhmedM-Dev/crow/commit/d43233a6a28678ef6180c66dfaebcfbdf7c1f01f