Hi, folks!
I've custom boost build in folder /opt/dps/libraries/boost_1_60_0.
And I'm building cpp-netlib with following commands:
mkdir build
cd build
BOOST_ROOT=/opt//dps/libraries/boost_1_60_0 cmake .. -DCMAKE_INSTALL_PREFIX=/opt/dps/libraries/cpp_netlib_0_12_0
make -j
make install
But when I try to compile my example tool:
#include <iostream>
#include <boost/network/protocol/http/client.hpp>
using namespace boost::network;
int main() {
std::string url = "
ya.ru";
http::client client;
http::client::request request(url);
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;
}
I've got a lot of errors similar to this error:
/opt/dps/libraries/cpp_netlib_0_12_0/include/boost/network/uri/builder.hpp:9:31: fatal error: asio/ip/address.hpp: No such file or directory
So I decided to replace "#include <asio/" by "#include <boost/asio" but then I've got a lot of more complex errors about "error: no match for call to ‘(boost::network::http::impl::http_async_connection<Tag, version_major, version_minor>::start(const request&," and "error: ‘boost::asio::detail::wrapped_handler<boost::asio::io_service::strand std::size_t)>’, is used but never defined [-fpermissive]".
What's correct way how I could install cpp-netlib and use with my application?
Thanks a lot!