C++ cpp netlib hello world示例无法在linux上编译

C++ cpp netlib hello world示例无法在linux上编译,c++,linux,cpp-netlib,C++,Linux,Cpp Netlib,我尝试在cpp-netlib.org上运行hello world示例,在Ubuntu 16.04上使用cpp-netlib-0.12.0和boost-1.64.0。一段代码是(来自第1行): 我得到以下错误: test1.cpp:11:61: error: ‘boost::network::http::server<hello_world>::response’ has not been declared void operator()(server::request co

我尝试在cpp-netlib.org上运行hello world示例,在Ubuntu 16.04上使用cpp-netlib-0.12.0和boost-1.64.0。一段代码是(来自第1行):

我得到以下错误:

test1.cpp:11:61: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
     void operator()(server::request const &request, server::response &response)
                                                             ^
test1.cpp: In member function ‘void hello_world::operator()(const request&, int&)’:
test1.cpp:17:28: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
         response = server::response::stock_reply(server::response::ok, data.str());
                            ^
test1.cpp:17:58: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
         response = server::response::stock_reply(server::response::ok, data.str());
                                                          ^
test1.cpp:11:61:错误:“boost::network::http::server::response”尚未声明
void操作符()(服务器::请求常量&请求,服务器::响应&响应)
^
test1.cpp:在成员函数“void hello_world::operator()(const request&,int&)”中:
test1.cpp:17:28:错误:“boost::network::http::server::response”尚未声明
response=server::response::stock_reply(server::response::ok,data.str());
^
test1.cpp:17:58:错误:“boost::network::http::server::response”尚未声明
response=server::response::stock_reply(server::response::ok,data.str());
^

我从网站上的示例中直接获取了代码。我检查了include路径,所有必要的库都显示在那里。我似乎不知道问题出在哪里。

似乎cpp netlib的文档都搞砸了(就像整个项目一样)。坚持认为
http::server
Handler
模板参数应该有成员
operator()
connection\u ptr
作为第二个参数(尽管它建议错误的包括):

#包括
#包括
结构处理器类型;
typedef boost::network::http::server http_server;
结构处理程序类型
{
无效的
运算符()
(
http_服务器::请求常量和请求,
http_服务器::连接\u ptr连接
)
{
//在这里做点什么
}
};
g++ test1.cpp -o test1 -std=c++11 -lcppnetlib-uri -lcppnetlib-server-parsers -lcppnetlib-client-connections -lboost_system -lboost_thread -lpthread
test1.cpp:11:61: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
     void operator()(server::request const &request, server::response &response)
                                                             ^
test1.cpp: In member function ‘void hello_world::operator()(const request&, int&)’:
test1.cpp:17:28: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
         response = server::response::stock_reply(server::response::ok, data.str());
                            ^
test1.cpp:17:58: error: ‘boost::network::http::server<hello_world>::response’ has not been declared
         response = server::response::stock_reply(server::response::ok, data.str());
                                                          ^