boost库

时间:2023-02-23 08:57:56


1.安装 2020.06.06 最新版本是1.73,下载地址: ​​https://www.boost.org/users/history/​

tar zxvf boost_1_59_0.tar.gz cd boost_1_59_0 ./bootstrap.sh --prefix=/usr/local/boost ./b2 install

默认的prefix是/usr/local,如果使用默认prefix,如果使用prefix就不用添加环境变量

接下来需要配置一下环境,打开/etc/profile,添加以下内容:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/boost/lib
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/boost/lib
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/boost/include
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/boost/include
source /etc/profile

安装结束