将 Boost 安装到自定义目录

Lia*_*ler 5 c++ boost

我尝试按照Boost 在其文档中提供的教程安装 boost,并查看了此处的其他一些问题,以尝试确定为什么我无法在自定义位置安装 Boost。也许我误解了,但该--prefix选项应该指定 Boost 标头和库的位置,然后bootstrapper.sh创建一个在运行.jam时使用的文件。b2bjam

当我发出以下命令时

 ./bootstrap.sh --prefix="$HOME/dev/emulator/src/boost" --includedir=headers --libdir=dist --with-libraries=date_time
Run Code Online (Sandbox Code Playgroud)

我看到正确的行已添加到生成的project-config.jam文件中

option.set prefix : /home/liam/dev/emulator/src/boost ;
option.set exec-prefix : /home/liam/dev/emulator/src/boost ;
option.set libdir : dist ;
option.set includedir : headers ;
Run Code Online (Sandbox Code Playgroud)

但是,当我./b2按照文档的指示运行时,它将 Boost 库安装到源文件夹中;IE

The following directory should be added to compiler include paths:

    /home/liam/Downloads/brave/boost_1_66_0

The following directory should be added to linker library paths:

    /home/liam/Downloads/brave/boost_1_66_0/stage/lib
Run Code Online (Sandbox Code Playgroud)

并且运行./b2 install也不给我任何文件输出到预期的目录。

HEK*_*KTO 6

您需要在这两个步骤中使用您的目录:

DST_DIR=${HOME}/dev/emulator/src/boost

./bootstrap.sh --prefix=${DST_DIR} --includedir=headers --libdir=dist --with-libraries=date_time
./b2 --prefix=${DST_DIR} install
Run Code Online (Sandbox Code Playgroud)