c++ - 将 Boost 库安装到 ~ (home) 中的自定义目录

标签 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

所以库要放在我的主目录中。

然后我跑了,

./b2 install

我也试过这样运行,

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

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

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

我也试过运行,

$ sudo ./bootstrap.sh

然后

$ sudo ./b2 install

因此安装将转到“/usr/local/lib”,并且它确实有效, 但未能成功安装到自定义目录。

谢谢

最佳答案

如上评论所述,

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

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

谢谢

有关 $HOME 和 '~/' 的更多详细信息,请访问该链接,

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

关于c++ - 将 Boost 库安装到 ~ (home) 中的自定义目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48208047/

相关文章:

c++ - 将dll编译为静态库时如何处理DLL_EXPORT?

c++ - 捕获网络状态变化事件

c++ - 如何提高计算 float 的精度?

c++ - 使用 istream 从 boost::asio UDP 套接字中检索 float

c++ - 发送 void 类型定义的函数指针作为要调用的参数

linux - 是否可以在 Linux 上使用独立的 google Earth 作为 [google-earth-plugin] 的替代品?

ubuntu - x11vnc xopendisplay 失败

python - 操作错误 : attempt to write a readonly database in ubuntu server

c++ - 如何在结构中使用 boost 库中的矩阵?

c++ - 谁更快 : BOOST_FOREACH macros or for