Skip to content

restinio/0.7.3 not compatible with boost/1.87.0 #229

@gegles

Description

@gegles

When I try to compile my project with restinio/0.7.3 and boost/1.87.0 I get the following errors:

/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1134:18: error: no template named 'buffer_cast' in namespace 'restinio::asio_ns'; did you mean 'buffer_copy'?
 1134 |                                                                 asio_ns::buffer_cast< const char * >(
      |                                                                 ~~~~~~~~~^
/Users/gegles/.conan2/p/boostd9e70cfb9dd1c/p/include/boost/asio/buffer.hpp:2469:20: note: 'buffer_copy' declared here
 2469 | inline std::size_t buffer_copy(const MutableBufferSequence& target,
      |                    ^
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.cpp:11:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/gateway.hpp:8:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.hpp:8:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/all.hpp:12:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/core.hpp:20:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server.hpp:14:
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/acceptor.hpp:266:46: error: no member named 'max_connections' in 'boost::asio::socket_base'
  266 |                                 m_acceptor.listen( asio_ns::socket_base::max_connections );
      |                                                    ~~~~~~~~~~~~~~~~~~~~~~^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/acceptor.hpp:623:36: error: no member named 'from_string' in 'boost::asio::ip::address'
  623 |                                 result = asio_ns::ip::address::from_string( str_addr );
      |                                          ~~~~~~~~~~~~~~~~~~~~~~^
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.cpp:11:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/gateway.hpp:8:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.hpp:8:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/all.hpp:12:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/core.hpp:20:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server.hpp:14:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/acceptor.hpp:17:
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1134:9: error: no matching function for call to 'buffer_copy'
 1134 |                                                                 asio_ns::buffer_cast< const char * >(
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1131:22: note: while substituting into a lambda expression here
 1131 |                                         m_logger.trace( [&]{
      |                                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1086:5: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>::init_write' requested here
 1086 |                                 init_write();
      |                                 ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1048:6: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>::init_write_if_necessary' requested here
 1048 |                                         init_write_if_necessary();
      |                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:964:8: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>::write_response_parts_impl' requested here
  964 |                                                         write_response_parts_impl(
      |                                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:367:3: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>::write_response_parts' requested here
  367 |                 connection_t(
      |                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__memory/construct_at.h:41:83: note: (skipping 10 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
   41 |   return ::new (const_cast<void*>(static_cast<const volatile void*>(__location))) _Tp(std::forward<_Args>(__args)...);
      |                                                                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__memory/shared_ptr.h:831:15: note: in instantiation of function template specialization 'std::allocate_shared<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>, std::allocator<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>>, restinio::basic_server_settings_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>, restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>> &, boost::asio::io_context &, std::shared_ptr<restinio::impl::connection_factory_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>>, restinio::null_logger_t &, void>' requested here
  831 |   return std::allocate_shared<_Tp>(allocator<_Tp>(), std::forward<_Args>(__args)...);
      |               ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server.hpp:219:10: note: in instantiation of function template specialization 'std::make_shared<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>, restinio::basic_server_settings_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>, restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>> &, boost::asio::io_context &, std::shared_ptr<restinio::impl::connection_factory_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>>, restinio::null_logger_t &, void>' requested here
  219 |                                 std::make_shared< acceptor_t >(
      |                                      ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server_run.hpp:1048:5: note: in instantiation of function template specialization 'restinio::http_server_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>::http_server_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>>' requested here
 1048 |                 :       m_server{ std::move(io_context), std::move(settings) }
      |                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server_run.hpp:1205:8: note: in instantiation of member function 'restinio::running_server_instance_t<restinio::http_server_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>>::running_server_instance_t' requested here
 1205 |                         new running_server_instance_t< http_server_t<Traits> >{
      |                             ^
/Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.cpp:490:29: note: in instantiation of function template specialization 'restinio::run_async<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>, boost::asio::strand<boost::asio::any_io_executor>, restinio::impl::tls_socket_t>>' requested here
  490 |     auto server = restinio::run_async(restinio::external_io_context(ioc), std::move(server_settings), NB_THREADS);
      |                             ^
/Users/gegles/.conan2/p/boostd9e70cfb9dd1c/p/include/boost/asio/buffer.hpp:2469:20: note: candidate function template not viable: requires 2 arguments, but 1 was provided
 2469 | inline std::size_t buffer_copy(const MutableBufferSequence& target,
      |                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2470 |     const ConstBufferSequence& source) noexcept
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/gegles/.conan2/p/boostd9e70cfb9dd1c/p/include/boost/asio/buffer.hpp:2506:20: note: candidate function template not viable: requires 3 arguments, but 1 was provided
 2506 | inline std::size_t buffer_copy(const MutableBufferSequence& target,
      |                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2507 |     const ConstBufferSequence& source,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2508 |     std::size_t max_bytes_to_copy) noexcept
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.cpp:11:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/gateway.hpp:8:
In file included from /Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.hpp:8:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/all.hpp:12:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/core.hpp:20:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server.hpp:14:
In file included from /Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/acceptor.hpp:17:
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1134:9: error: no matching function for call to 'buffer_copy'
 1134 |                                                                 asio_ns::buffer_cast< const char * >(
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1131:22: note: while substituting into a lambda expression here
 1131 |                                         m_logger.trace( [&]{
      |                                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1086:5: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>::init_write' requested here
 1086 |                                 init_write();
      |                                 ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:1048:6: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>::init_write_if_necessary' requested here
 1048 |                                         init_write_if_necessary();
      |                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:964:8: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>::write_response_parts_impl' requested here
  964 |                                                         write_response_parts_impl(
      |                                                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/impl/connection.hpp:367:3: note: in instantiation of member function 'restinio::impl::connection_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>::write_response_parts' requested here
  367 |                 connection_t(
      |                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__memory/construct_at.h:41:83: note: (skipping 10 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
   41 |   return ::new (const_cast<void*>(static_cast<const volatile void*>(__location))) _Tp(std::forward<_Args>(__args)...);
      |                                                                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__memory/shared_ptr.h:831:15: note: in instantiation of function template specialization 'std::allocate_shared<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>, std::allocator<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>>, restinio::basic_server_settings_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>, restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>> &, boost::asio::io_context &, std::shared_ptr<restinio::impl::connection_factory_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>>, restinio::null_logger_t &, void>' requested here
  831 |   return std::allocate_shared<_Tp>(allocator<_Tp>(), std::forward<_Args>(__args)...);
      |               ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server.hpp:219:10: note: in instantiation of function template specialization 'std::make_shared<restinio::impl::acceptor_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>, restinio::basic_server_settings_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>, restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>> &, boost::asio::io_context &, std::shared_ptr<restinio::impl::connection_factory_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>>, restinio::null_logger_t &, void>' requested here
  219 |                                 std::make_shared< acceptor_t >(
      |                                      ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server_run.hpp:1048:5: note: in instantiation of function template specialization 'restinio::http_server_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>::http_server_t<restinio::server_settings_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>>' requested here
 1048 |                 :       m_server{ std::move(io_context), std::move(settings) }
      |                         ^
/Users/gegles/.conan2/p/b/resti4a3f0ef0586d7/p/include/restinio/http_server_run.hpp:1205:8: note: in instantiation of member function 'restinio::running_server_instance_t<restinio::http_server_t<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>>::running_server_instance_t' requested here
 1205 |                         new running_server_instance_t< http_server_t<Traits> >{
      |                             ^
/Users/gegles/Workspaces/aspera/faspio-gateway/src/gateway/faspio/gateway/rest_api.cpp:497:29: note: in instantiation of function template specialization 'restinio::run_async<restinio::traits_t<restinio::asio_timer_manager_t, restinio::null_logger_t, restinio::sync_chain::growable_size_chain_t<>>>' requested here
  497 |     auto server = restinio::run_async(restinio::external_io_context(ioc), std::move(server_settings), NB_THREADS);
      |                             ^
/Users/gegles/.conan2/p/boostd9e70cfb9dd1c/p/include/boost/asio/buffer.hpp:2469:20: note: candidate function template not viable: requires 2 arguments, but 1 was provided
 2469 | inline std::size_t buffer_copy(const MutableBufferSequence& target,
      |                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2470 |     const ConstBufferSequence& source) noexcept
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/gegles/.conan2/p/boostd9e70cfb9dd1c/p/include/boost/asio/buffer.hpp:2506:20: note: candidate function template not viable: requires 3 arguments, but 1 was provided
 2506 | inline std::size_t buffer_copy(const MutableBufferSequence& target,
      |                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2507 |     const ConstBufferSequence& source,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2508 |     std::size_t max_bytes_to_copy) noexcept
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.

It's probably not too much work to adjust the restinio code, but I don't have the bandwidth to learn the code and upgrade it, so hopefully one of the maintainer can do this.

Much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions