简体   繁体   English

编译Boost.Asio示例代码时出错

[英]Error compiling Boost.Asio example code

I'm trying to get to grips with boost asio using the provided daytime examples here . 我正在尝试使用提供的白天示例处理提升asio。 But when I try to compile it, I get this error: 但是当我尝试编译它时,我收到此错误:

‘boost::asio::ip::tcp::acceptor’ has no member named ‘io_service’ 

Here's the relevant code section: 这是相关的代码部分:

 void start_accept()
  {
    tcp_connection::pointer new_connection =
      tcp_connection::create(acceptor_.io_service());

In the linked source code the line goes like this: 在链接的源代码中,行如下所示:

tcp_connection::create(acceptor_.get_io_service());

You should revert that change you made to your copy. 您应该还原您对副本所做的更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM