Skip to content

Boost ASIO resolver.resolve is deprecated #1

@JuKu

Description

@JuKu

Hi,

thank you for your great work!
I really like this header only library for redis!

But i get the following compilation error:

In file included from /cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/3rdparty/redis-cpp/include/redis-cpp/stream.h:31,
                 from /cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/mmo-proxy-server.cpp:15:
/cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/3rdparty/redis-cpp/include/redis-cpp/detail/stream.hpp: In constructor 'rediscpp::detail::stream::stream(std::string_view, std::string_view)':
/cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/3rdparty/redis-cpp/include/redis-cpp/detail/stream.hpp:78:53: error: no matching function for call to 'boost::asio::ip::basic_resolver<boost::asio::ip::tcp>::resolve(std::string_view&, std::string_view&)'
   78 |         auto endpoints = resolver.resolve(host, port);
      |                                                     ^
In file included from /usr/include/boost/asio.hpp:80,
                 from /cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/3rdparty/redis-cpp/include/redis-cpp/detail/stream.hpp:15,
                 from /cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/3rdparty/redis-cpp/include/redis-cpp/stream.h:31,
                 from /cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/mmo-proxy-server.cpp:15:
/usr/include/boost/asio/ip/basic_resolver.hpp:214:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const query&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::query = boost::asio::ip::basic_resolver_query<boost::asio::ip::tcp>]'
  214 |   results_type resolve(const query& q)
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:214:16: note:   candidate expects 1 argument, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:235:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const query&, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::query = boost::asio::ip::basic_resolver_query<boost::asio::ip::tcp>]'
  235 |   results_type resolve(const query& q, boost::system::error_code& ec)
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:235:37: note:   no known conversion for argument 1 from 'std::string_view' {aka 'std::basic_string_view<char>'} to 'const query&' {aka 'const boost::asio::ip::basic_resolver_query<boost::asio::ip::tcp>&'}
  235 |   results_type resolve(const query& q, boost::system::error_code& ec)
      |                        ~~~~~~~~~~~~~^
/usr/include/boost/asio/ip/basic_resolver.hpp:274:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  274 |   results_type resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:274:53: note:   no known conversion for argument 1 from 'std::string_view' {aka 'std::basic_string_view<char>'} to 'std::experimental::fundamentals_v1::string_view' {aka 'std::experimental::fundamentals_v1::basic_string_view<char>'}
  274 |   results_type resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
      |                                                     ^
/usr/include/boost/asio/ip/basic_resolver.hpp:313:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  313 |   results_type resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:313:16: note:   candidate expects 3 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:356:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::asio::ip::resolver_base::flags) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  356 |   results_type resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:356:16: note:   candidate expects 3 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:405:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::asio::ip::resolver_base::flags, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  405 |   results_type resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:405:16: note:   candidate expects 4 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:450:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const protocol_type&, std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::protocol_type = boost::asio::ip::tcp; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  450 |   results_type resolve(const protocol_type& protocol,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:450:16: note:   candidate expects 3 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:492:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const protocol_type&, std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::protocol_type = boost::asio::ip::tcp; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  492 |   results_type resolve(const protocol_type& protocol,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:492:16: note:   candidate expects 4 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:539:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const protocol_type&, std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::asio::ip::resolver_base::flags) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::protocol_type = boost::asio::ip::tcp; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  539 |   results_type resolve(const protocol_type& protocol,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:539:16: note:   candidate expects 4 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:593:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const protocol_type&, std::experimental::fundamentals_v1::string_view, std::experimental::fundamentals_v1::string_view, boost::asio::ip::resolver_base::flags, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::protocol_type = boost::asio::ip::tcp; std::experimental::fundamentals_v1::string_view = std::experimental::fundamentals_v1::basic_string_view<char>]'
  593 |   results_type resolve(const protocol_type& protocol,
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:593:16: note:   candidate expects 5 arguments, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:932:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const endpoint_type&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::endpoint_type = boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>]'
  932 |   results_type resolve(const endpoint_type& e)
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:932:16: note:   candidate expects 1 argument, 2 provided
/usr/include/boost/asio/ip/basic_resolver.hpp:955:16: note: candidate: 'boost::asio::ip::basic_resolver<InternetProtocol>::results_type boost::asio::ip::basic_resolver<InternetProtocol>::resolve(const endpoint_type&, boost::system::error_code&) [with InternetProtocol = boost::asio::ip::tcp; boost::asio::ip::basic_resolver<InternetProtocol>::results_type = boost::asio::ip::basic_resolver_results<boost::asio::ip::tcp>; boost::asio::ip::basic_resolver<InternetProtocol>::endpoint_type = boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>]'
  955 |   results_type resolve(const endpoint_type& e, boost::system::error_code& ec)
      |                ^~~~~~~
/usr/include/boost/asio/ip/basic_resolver.hpp:955:45: note:   no known conversion for argument 1 from 'std::string_view' {aka 'std::basic_string_view<char>'} to 'const endpoint_type&' {aka 'const boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>&'}
  955 |   results_type resolve(const endpoint_type& e, boost::system::error_code& ec)
      |                        ~~~~~~~~~~~~~~~~~~~~~^
make[3]: *** [CMakeFiles/ProxyServer.dir/build.make:63: CMakeFiles/ProxyServer.dir/mmo-proxy-server.cpp.o] Error 1
make[3]: Leaving directory '/cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/cmake-build-debug'
make[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/ProxyServer.dir/all] Error 2
make[2]: Leaving directory '/cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/cmake-build-debug'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ProxyServer.dir/rule] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Justin/IdeaProjects/MMOPrototyp/mmo-proxy-server/cmake-build-debug'
make: *** [Makefile:118: ProxyServer] Error 2

As screenshot:
grafik

The problem is, that the resolve function is already deprecated.
grafik

See also: https://www.boost.org/doc/libs/1_66_0/doc/html/boost_asio/reference/ip__tcp/resolver.html

Can you please fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions