Skip to content

build fails with boost 1.87 #52

@milahu

Description

@milahu
src/main.cpp:68:20: error: 'io_service' has not been declared in 'boost::asio'
   68 | using boost::asio::io_service;
      |                    ^~~~~~~~~~
all errors
src/main.cpp:68:20: error: 'io_service' has not been declared in 'boost::asio'
   68 | using boost::asio::io_service;
      |                    ^~~~~~~~~~
src/main.cpp: In function 'void print_stats(boost::asio::steady_timer&, const boost::system::error_code&)':
src/main.cpp:250:21: error: 'boost::asio::steady_timer' {aka 'class boost::asio::basic_waitable_timer<std::chrono::_V2::steady_clock>'} has no member named 'expires_from_now'
  250 |         stats_timer.expires_from_now(seconds(print_stats_interval));
      |                     ^~~~~~~~~~~~~~~~
src/main.cpp: At global scope:
src/main.cpp:353:32: error: expected ')' before '&' token
  353 |         bound_socket(io_service& ios, udp::endpoint ep)
      |                     ~          ^
      |                                )
src/main.cpp: In function 'bool is_valid_ep(const boost::asio::ip::udp::endpoint&)':
src/main.cpp:461:41: error: 'const class boost::asio::ip::address_v4' has no member named 'to_ulong'
  461 |                 unsigned long ip = addr.to_ulong();
      |                                         ^~~~~~~~
src/main.cpp:475:57: error: 'const class boost::asio::ip::address_v6' has no member named 'is_v4_compatible'
  475 |                         || addr.is_site_local() || addr.is_v4_compatible()
      |                                                         ^~~~~~~~~~~~~~~~
src/main.cpp: In function 'void rotate_secrets(boost::asio::steady_timer&, std::random_device&, const boost::system::error_code&)':
src/main.cpp:513:23: error: 'boost::asio::steady_timer' {aka 'class boost::asio::basic_waitable_timer<std::chrono::_V2::steady_clock>'} has no member named 'expires_from_now'
  513 |         secrets_timer.expires_from_now(seconds(rotate_secrets_interval));
      |                       ^~~~~~~~~~~~~~~~
src/main.cpp: At global scope:
src/main.cpp:1137:9: error: 'io_service' does not name a type
 1137 |         io_service ios;
      |         ^~~~~~~~~~
src/main.cpp: In constructor 'router_thread::router_thread(const char*, int, std::vector<boost::asio::ip::address>)':
src/main.cpp:583:27: error: 'ios' was not declared in this scope; did you mean 'std::ios'?
  583 |                 , signals(ios)
      |                           ^~~
      |                           std::ios
In file included from /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/bits/shared_ptr.h:52,
                 from /nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/memory:80,
                 from include/boost/asio/detail/memory.hpp:21,
                 from include/boost/asio/detail/handler_alloc_helpers.hpp:19,
                 from include/boost/asio/detail/executor_function.hpp:19,
                 from include/boost/asio/execution/any_executor.hpp:24,
                 from include/boost/asio/execution.hpp:19,
                 from include/boost/asio/any_completion_executor.hpp:22,
                 from include/boost/asio.hpp:20,
                 from src/main.cpp:36:
/nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/iosfwd:134:41: note: 'std::ios' declared here
  134 |   typedef basic_ios<char>               ios;
      |                                         ^~~
src/main.cpp: In member function 'void router_thread::signal_handler(const boost::system::error_code&, int)':
src/main.cpp:614:17: error: 'ios' was not declared in this scope; did you mean 'std::ios'?
  614 |                 ios.stop();
      |                 ^~~
      |                 std::ios
/nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/iosfwd:134:41: note: 'std::ios' declared here
  134 |   typedef basic_ios<char>               ios;
      |                                         ^~~
src/main.cpp: In member function 'void router_thread::send_ping(const queued_node_t&)':
src/main.cpp:654:59: error: no matching function for call to 'boost::asio::ip::address::to_string(boost::system::error_code&)'
  654 |                                 , n.ep.address().to_string(ec).c_str(), n.ep.port());
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from include/boost/asio/ip/address.hpp:254,
                 from include/boost/asio.hpp:114:
include/boost/asio/ip/impl/address.ipp:174:13: note: candidate: 'std::string boost::asio::ip::address::to_string() const'
include/boost/asio/ip/impl/address.ipp:174:13: note:   candidate expects 0 arguments, 1 provided
src/main.cpp: In member function 'void router_thread::send_request(const queued_node_t&)':
src/main.cpp:709:59: error: no matching function for call to 'boost::asio::ip::address::to_string(boost::system::error_code&)'
  709 |                                 , n.ep.address().to_string(ec).c_str(), n.ep.port());
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
include/boost/asio/ip/impl/address.ipp:174:13: note: candidate: 'std::string boost::asio::ip::address::to_string() const'
include/boost/asio/ip/impl/address.ipp:174:13: note:   candidate expects 0 arguments, 1 provided
src/main.cpp: In member function 'void router_thread::start()':
src/main.cpp:765:49: error: 'ios' was not declared in this scope; did you mean 'std::ios'?
  765 |                         size_t const executed = ios.run_one(ec);
      |                                                 ^~~
      |                                                 std::ios
/nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/iosfwd:134:41: note: 'std::ios' declared here
  134 |   typedef basic_ios<char>               ios;
      |                                         ^~~
src/main.cpp: At global scope:
src/main.cpp:1201:38: error: 'io_service' has not been declared
 1201 |         , steady_timer& stats_timer, io_service& ios)
      |                                      ^~~~~~~~~~
src/main.cpp: In function 'void signal_handler(const boost::system::error_code&, int, boost::asio::signal_set&, boost::asio::steady_timer&, int&)':
src/main.cpp:1207:21: error: request for member 'post' in 'ios', which is of non-class type 'int'
 1207 |                 ios.post(std::bind(&print_stats, std::ref(stats_timer), ec));
      |                     ^~~~
src/main.cpp:1214:13: error: request for member 'stop' in 'ios', which is of non-class type 'int'
 1214 |         ios.stop();
      |             ^~~~
src/main.cpp: In function 'int main(int, char**)':
src/main.cpp:1340:57: error: 'from_string' is not a member of 'boost::asio::ip::address'
 1340 |                         bootstrap_node.address(address::from_string(argv[i], ec));
      |                                                         ^~~~~~~~~~~
src/main.cpp:1363:55: error: 'from_string' is not a member of 'boost::asio::ip::address_v6'
 1363 |                         address_v6 addr = address_v6::from_string(argv[i], ec);
      |                                                       ^~~~~~~~~~~
src/main.cpp:1409:58: error: 'from_string' is not a member of 'boost::asio::ip::address_v4'
 1409 |                 address_v4 our_external_ip = address_v4::from_string(argv[1], ec);
      |                                                          ^~~~~~~~~~~
src/main.cpp:1421:9: error: 'io_service' was not declared in this scope
 1421 |         io_service ios;
      |         ^~~~~~~~~~
src/main.cpp:1423:34: error: 'ios' was not declared in this scope; did you mean 'std::ios'?
 1423 |         steady_timer stats_timer(ios);
      |                                  ^~~
      |                                  std::ios
/nix/store/sa7j7cddyblhcb3ch3ds10w7nw75yjj1-gcc-14.3.0/include/c++/14.3.0/iosfwd:134:41: note: 'std::ios' declared here
  134 |   typedef basic_ios<char>               ios;
      |                                         ^~~
src/main.cpp:1424:21: error: 'boost::asio::steady_timer' {aka 'class boost::asio::basic_waitable_timer<std::chrono::_V2::steady_clock>'} has no member named 'expires_from_now'
 1424 |         stats_timer.expires_from_now(seconds(print_stats_interval));
      |                     ^~~~~~~~~~~~~~~~
src/main.cpp:1443:23: error: 'boost::asio::steady_timer' {aka 'class boost::asio::basic_waitable_timer<std::chrono::_V2::steady_clock>'} has no member named 'expires_from_now'
 1443 |         secrets_timer.expires_from_now(seconds(rotate_secrets_interval));
      |                       ^~~~~~~~~~~~~~~~

see also DavidKeller/kademlia#11

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