1,编译出错:
undefined reference to `boost::system::system_category()' 增加编译选项 -l boost_system
undefined reference to `pthread_getspecific' 增加编译选项 -lpthread
则最终的gcc编译命令为:g++ server.cpp -o main -l boost_system -lpthread
2,运行出错
./main: error while loading shared libraries: libboost_system.so.1.49.0: cannot open shared object file: No such file or directory
输入ldconfig命令,
ldconfig是一个动态链接库管理命令,为了让动态链接库为系统所共享