- Linux安装boost
- sudo apt install libboost-all-dev
- 卸载
- sudo apt-get autoremove libboost*
- 静态看缺少 -fpic (如下报错时)
usrbin/ld:/usr/Lib/x86_64-linux-gnu/Libboost_filesystem.a(operations.o): warning: relocation against _zst7nothroweeGLIBcxx_3.4’in read-only section `.text’
usr/bin/td:/usr/Lib/x86_64-Linux-gnu/Libboost_filesystem.adirectory.o):relocation R_X86_64_pc32 against symbolZNSbostbsystemdetaillocat holderIvE24systencatego ry_instancee’ can not be used when making a shared object; recompile with -fpic- 查看 boost 版本:vi /usr/include/boost/version.hpp (或 /usr/local/include/boost/version.hpp)
- 下载对应包:https://www.boost.org/
- 编译
./bootstrap.sh ./b2 -j10 cflags=-fPIC cxxflags=-fPIC #install --build-type=complete --layout=versioned threading=multi --prefix="/usr/lib/boost-1.74" --without-python --without-graph --without-graph_parallel --without-mpi --without-wave --without-test --without-log sudo ./b2 install
boost 安装使用
于 2023-04-19 11:12:41 首次发布