通过镜像源安装libevent sudo yum install libevent libevent-devel # client.cpp 是使用libevent库写的 echoserver g++ -o client ./client.cpp -lpthread -levent -std=c++11 libevent例子