Skip to content

Compiling on debian 12 #7152

@datendelphin

Description

@datendelphin

Issue

Compiling on debian 12 I get the following error:

In file included from /usr/include/boost/asio.hpp:23,
                 from /srv/osrm/osrm-backend/include/server/http/reply.hpp:6,
                 from /srv/osrm/osrm-backend/include/server/connection.hpp:5,
                 from /srv/osrm/osrm-backend/src/server/connection.cpp:1:
/usr/include/boost/asio/awaitable.hpp: In constructor ‘boost::asio::awaitable<T, Executor>::awaitable(boost::asio::awaitable<T, Executor>&&)’:
/usr/include/boost/asio/awaitable.hpp:68:19: error: ‘exchange’ is not a member of ‘std’; did you mean ‘std::__atomic_impl::exchange’?
   68 |     : frame_(std::exchange(other.frame_, nullptr))
      |                   ^~~~~~~~
In file included from /usr/include/c++/12/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/12/memory:78,
                 from /usr/include/boost/asio/associated_allocator.hpp:19,
                 from /usr/include/boost/asio.hpp:20:
/usr/include/c++/12/bits/atomic_base.h:976:7: note: ‘std::__atomic_impl::exchange’ declared here
  976 |       exchange(_Tp* __ptr, _Val<_Tp> __desired, memory_order __m) noexcept
      |       ^~~~~~~~

Seems to be a problem of boost asio on debian.

Workaround:

adding
#include <utility>
before the #include <boost/asio.hpp>

Specifications

  • Debian 12
  • gcc 12.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions