首先需要安装boost库
sudo apt-get update
sudo apt-get install libboost-all-dev
测试boost库是否安装成功 创建testboost.cpp
#include <iostream>
#include <boost/bind.hpp>
#include <string>
using namespace std;
class Hello
{
public:
void say(string name)
{ cout << name << " say: hello world!" << endl; }
};
int main()
{
Hello h;
auto func = boost::bind(&Hello::say, &h, "zhang san");
func();
return 0;
}
运行g++ -o test testboost.cpp -std=c++11
运行./test
输出zhang san say: hello world!
则说明boost安装成功
接下来安装Muduo
https://blog.csdn.net/QIANGWEIYUAN/article/details/89023980