将Boost库安装到〜(home)中的自定义目录

时间:2018-01-11 13:17:41

标签: c++ ubuntu boost

我正在尝试构建boost库

正如我在手册中看到的那样,

http://www.boost.org/doc/libs/1_62_0/more/getting_started/unix-variants.html#easy-build-and-install

如手册所述,我正在运行命令

$ ./bootstrap.sh --prefix=path/to/installation/prefix

使用--prefix =〜/ boost-libs,像这样,

$ ./bootstrap.sh --prefix=~/boost-libs

所以将lib放在我的主目录中。

之后我跑了,

./b2 install

我也试图像这样运行它,

./b2 install --prefix=~/boost-libs

但是没有什么可以放在' boost-libs'在我的主文件夹中。

  • 文件夹' boost-libs'存在于我的主文件夹中。

我也尝试过跑,

$ sudo ./bootstrap.sh

然后

$ sudo ./b2 install

所以安装将转到' / usr / local / lib', 工作, 但未成功安装到自定义目录。

由于

1 个答案:

答案 0 :(得分:0)

如上述评论所述,

使用$ HOME而不是'〜/'运行它解决了这个问题,

./bootstrap.sh --prefix=$HOME/boost-libs

由于

有关$ HOME和'〜/'的详细信息在那个链接上,

Difference between $HOME and '~' (tilde)?