Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost version is wrong. #429

Open
eternally123 opened this issue Dec 13, 2019 · 3 comments
Open

boost version is wrong. #429

eternally123 opened this issue Dec 13, 2019 · 3 comments

Comments

@eternally123
Copy link

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

@chenshuo
Copy link
Owner

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

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

@tan-wei
Copy link
Contributor

tan-wei commented Apr 17, 2020

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
Copy link
Contributor

tan-wei commented Apr 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants