muduo icon indicating copy to clipboard operation
muduo copied to clipboard

boost version is wrong.

Open jackwsl opened this issue 6 years ago • 3 comments

An error occurred while compiling muduo:

/home/shiliangw/code/muduo/examples/ace/ttcp/ttcp_asio_async.cc:147:76: error: ‘boost::asio::ip::tcp::acceptor’ {aka ‘class boost::asio::basic_socket_acceptorboost::asio::ip::tcp’} has no member named ‘get_io_service’ 147 | TtcpServerConnectionPtr new_connection(new TtcpServerConnection(acceptor.get_io_service()));

i thought it is because of the version of boost is wrong,but i don't which version can fit muduo.

the environment in my os: gcc 9.2.0 cmake 3.15.4 boost 1.71

i want to know which version suits muduo thanks

jackwsl avatar Dec 13 '19 11:12 jackwsl

Try boost 1.69 or below, get_io_service() was removed in 1.70.0.

https://github.com/boostorg/asio/blob/95f7e936356810addf3a6b54dbd1129d10f3ba98/doc/history.qbk#L153

chenshuo avatar Dec 13 '19 23:12 chenshuo

Another easy solution to this when you want to use boost 1.70 and above is to use get_executor() instead of get_io_service(). The ctor of TtcpServerConnection should be changed, too.

tan-wei avatar Apr 17 '20 03:04 tan-wei

I've opened a PR #451 , it can fix this error. UPDATE: The PR is merged now.

tan-wei avatar Apr 21 '20 01:04 tan-wei