我已经将 boost 库从以前的 1.54(svn 源)更新到 1.57(git 源)。尽管我使用了相同的 ./b2 参数,但目标目录不包含 ptr_container
库。
具有克隆存储库的目录在此路径上正确包含 ptr_container 库:
boost_git/libs/ptr_container
我正在使用以下命令构建它:
./b2 --install --prefix=$SHL_PATH/boost -sNO_BZIP2=1 -sNO_ZLIB runtime-link=shared link=shared -j2 install
但没有成功。
编辑:
似乎只有从 git 构建时才会出现问题。当我从 boost 站点下载 zip 包时,目标目录正确包含 ptr_container。
这是我用来获取源代码的 git 命令:
git clone --recursive https://github.com/boostorg/boost.git boost_git
git checkout tags/boost-1.57.0
git submodule foreach --recursive git checkout tags/boost-1.57.0
我也尝试获取最新的 boost 版本,但是这个版本根本无法使用。在我执行 ./b2 后,我立即收到类似于此的奇怪错误:Buidling boost error: Name clash for '<pstage\lib>boost_system-vc120-mt-1_58.dll'
对于如何从 git 存储库正确获取和安装 boost 的任何提示,我将不胜感激。
最佳答案
git clone https://github.com/boostorg/boost.git cd boost git checkout boost-1.57.0 git submodule update --init --recursive ./bootstrap.sh sudo ./b2 install sudo ./b2 headers
正如 rivanov 指出的那样在评论中,./b2 headers
将仅 header 文件包含在安装目录中。
关于c++ - 从源代码编译后未安装 boost ptr_container 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27346593/