I'm trying to compile this code (taken from the cpp-netlib documentation):
#include <boost/network/protocol/http/client.hpp>
#include <iostream>
int main(int argc, char *argv[]) {
using namespace boost::network;
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
return 1;
}
http::client client;
http::client::request request(argv[1]);
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;
return 0;
}
However, it fails with this error:
Error C2446 ':': no conversion from 'boost::asio::error::netdb_errors' to 'const std::error_code'
I'm using VS2015, cpp-netlib 0.12.0 (final) and Boost 1.55.0, and I have no idea what could cause this. Is there a way to fix it? I've been scratching my head trying to get this library to work for a few days, but it seems a new error always has to come up unfortunately.