解压
- tar zxvf ./boost_1_55_0.tar.bz2
- ./bootstrap.sh --with-libraries=system,filesystem,log,thread --with-toolset=gcc
- ./b2 toolset=gcc cxxflags="-std=c++11"
备注:上面红色字体的你容,可以再配置后,看到其他的选项。上面绿色字体内容代表使用c++11标准,编译的库要使用统一标准。不使用,去掉绿色字体内容。
- ./b2 install --prefix=/usr
运行./b2 install 命令,默认安装在
/usr/local/lib目录下
头文件在
/usr/local/include/boost目录下