diff --git a/ntpdetails.cpp b/ntpdetails.cpp index 549fa60..d791821 100644 --- a/ntpdetails.cpp +++ b/ntpdetails.cpp @@ -12,7 +12,8 @@ void queryNTPServer(const std::string& server) { asio::io_context io_context; asio::ip::udp::resolver resolver(io_context); - asio::ip::udp::endpoint endpoint = *resolver.resolve(server, std::to_string(NTP_PORT)).begin(); + asio::ip::udp::resolver::query query(asio::ip::udp::v4(), server, std::to_string(NTP_PORT)); + asio::ip::udp::endpoint endpoint = *resolver.resolve(query).begin(); asio::ip::udp::socket socket(io_context); socket.open(asio::ip::udp::v4());