- 卸载boost库
sudo rm -f /usr/local/lib/libboost*
sudo rm -rf /usr/local/include/boost
sudo rm -r /usr/local/lib/cmake/boost*
sudo rm -r /usr/local/lib/cmake/Boost*
- 下载需要的boost
https://www.boost.org/users/history/
wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz #下载到linux上
3.安装
tar -zxvf boost_1_83_0.tar.gz
cd boost_1_83_0.tar.gz
sudo ./bootstrap.sh --with-libraries=all --with-toolset=gcc
sudo ./b2 toolset=gcc
sudo ./b2 --prefix=/usr/local/boost install
- 添加环境变量
vim ~/.bashrc
# 写入
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/boost/include
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/boost/lib
export LIBRARY_PATH CPLUS_INCLUDE_PATH
source ~/.bashrc
sudo ldconfig /usr/local/boost/lib/
5.cmake添加boost路径(可选)
cmake xx -DBOOST_ROOT=/home/cjq/lib/boost_1_83_0
标签:lib,boost,sudo,源码,usr,Ubuntu,PATH,local From: https://www.cnblogs.com/kirito-chen/p/17702047.html参考:
https://blog.csdn.net/challenglistic/article/details/129097988
https://blog.csdn.net/chen411120086/article/details/122618226