首先,我在我的Windows机器上运行了完全相同的代码,并且我没有太多使用linux,所以它可能是我试图编译它的问题.我很感激任何帮助,找出我得到的错误,因为我不确定是什么导致它,并通过文件树导致回到io_service.hpp,这应该没有问题(如果我正在做对的).
g++ -L/usr/include/ -lboost_regex Source.cpp -o source
Run Code Online (Sandbox Code Playgroud)
我的client.cpp代码
#include "client.h"
std::string port = "13"; /* Destination port. */
void client::write()
{
using namespace std; // For strlen.
std::cout << "Enter message: ";
char request[max_length];
std::cin.getline(request, max_length);
size_t request_length = strlen(request);
boost::asio::write(*s, boost::asio::buffer(request, request_length));
}
void client::send(char c[])
{
boost::asio::write(*s, boost::asio::buffer(c, max_length));
}
// This will be used by the edge nodes to connect to the server
client::client(void)
{
tcp::resolver resolver(io);
tcp::resolver::query query(tcp::v4(), "ALERT-Core-0", port);
tcp::resolver::iterator iterator = resolver.resolve(query);
s = …Run Code Online (Sandbox Code Playgroud)