-
Notifications
You must be signed in to change notification settings - Fork 425
Description
Using cpp-netlib 0.11.2, boost 1.54 and gcc 4.8.5 or gcc 5.2.1 compiling this example:
http://cpp-netlib.org/0.11.2/examples/http/hello_world_server.html
will fail.
First the example does not mention that a log handler is needed, this can be fixed with modifying the hello_world struct:
struct hello_world {
void operator() (server::request const &request,
server::response &response) {
std::string ip = source(request);
response = server::response::stock_reply(
server::response::ok, std::string("Hello, ") + ip + "!");
}
void log(...) {
}
};
But then it fails with:
g++-5 -std=c++11 -lcppnetlib-server-parsers -lboost_system -lboost_thread -pthread a.cpp :(
a.cpp: In function ‘int main(int, char*)’:
a.cpp:31:49: error: no matching function for call to ‘boost::network::http::server<hello_world>::server(char&, char*&, hello_world&)’
server server_(argv[1], argv[2], handler);
^
In file included from a.cpp:1:0:
/usr/include/boost/network/protocol/http/server.hpp:44:12: note: candidate: boost::network::http::server::server(const options&) [with Handler = hello_world; boost::network::http::server::options = boost::network::http::server_options<boost::network::http::tags::http_server, hello_world>]
explicit server(options const &options) : server_base(options) {}
^
/usr/include/boost/network/protocol/http/server.hpp:44:12: note: candidate expects 1 argument, 3 provided