title: Errors when compiling Boost ASIO examples
body: <p>I have been struggling for hours trying to get this example from the official boost homepage to run: </p>
  
  <pre><code>#include &lt;boost/asio/co_spawn.hpp&gt;
  #include &lt;boost/asio/detached.hpp&gt;
  #include &lt;boost/asio/io_context.hpp&gt;
  #include &lt;boost/asio/ip/tcp.hpp&gt;
  #include &lt;boost/asio/signal_set.hpp&gt;
  #include &lt;boost/asio/write.hpp&gt;
  #include &lt;cstdio&gt;
  
  using boost::asio::ip::tcp;
  using boost::asio::awaitable;
  using boost::asio::co_spawn;
  using boost::asio::detached;
  using boost::asio::use_awaitable;
  namespace this_coro = boost::asio::this_coro;
  
  awaitable&lt;void&gt; echo(tcp::socket socket)
  {
    try
    {
      char data[1024];
      for (;;)
      {
        std::size_t n = co_await socket.async_read_some(boost::asio::buffer(data), use_awaitable);
        co_await async_write(socket, boost::asio::buffer(data, n), use_awaitable);
      }
    }
    catch (std::exception&amp; e)
    {
      std::printf("echo Exception: %s\n", e.what());
    }
  }
  
  awaitable&lt;void&gt; listener()
  {
    auto executor = co_await this_coro::executor;
    tcp::acceptor acceptor(executor, {tcp::v4(), 55555});
    for (;;)
    {
      tcp::socket socket = co_await acceptor.async_accept(use_awaitable);
      co_spawn(executor,
          [socket = std::move(socket)]() mutable
          {
            return echo(std::move(socket));
          },
          detached);
    }
  }
  
  int main()
  {
    try
    {
      boost::asio::io_context io_context(1);
  
      boost::asio::signal_set signals(io_context, SIGINT, SIGTERM);
      signals.async_wait([&amp;](auto, auto){ io_context.stop(); });
  
      co_spawn(io_context, listener, detached);
  
      io_context.run();
    }
    catch (std::exception&amp; e)
    {
      std::printf("Exception: %s\n", e.what());
    }
  }
  </code></pre>
  
  <p>I'm on Linux and saved the source to <code>/usr/local/boost_1_70_0</code>. I read in the documentation that I had to include <code>&lt;boost/system/error_code&gt;</code> and <code>&lt;boost/system/system_error&gt;</code> (Why wasn't this in the code example?). After much reading here at StackOverflow, I figured out I should also use <code>-lboost_system</code>, but then the compiler just complained that it couldn't find it. Another tip was to use <code>-lpthread</code>, and now it stopped complaining about. The last command I tried was 
  <code>g++ -I /usr/local/boost_1_70_0  main.cpp -lpthread</code>
   However, it says:</p>
  
  <pre><code>error: ‘boost::asio::awaitable’ has not been declared
   using boost::asio::awaitable;
                      ^~~~~~~
  </code></pre>
  
  <p>Is this a bug in the code? It's extremely difficult for someone who have no experience using these libraries to get going when there are so many pitfalls. I can see that there are many others struggling with this, none of the answers seems to help in my case. Am I just stupid, or is there something wrong with the example? I am sorry for the long post, and I am forever grateful if someone could give me a hand, because I've struggled for many hours with this.</p>