【问题标题】:Skipped <dir> for lack of ... error while trying to install Boost 1.49 on Ubuntu 11.04尝试在 Ubuntu 11.04 上安装 Boost 1.49 时因缺少 ... 错误而跳过 <dir>
【发布时间】:2012-03-31 03:01:47
【问题描述】:

在尝试安装 Boost 1.49 时,当我到达使用 bjam 脚本的阶段时,我一直遇到一个持续存在的问题。作为参考,我遵循安装说明linked here,但我也参考了 boost.org 安装页面。程序基本相同,并且都给出了相同的问题。

我将 tar 文件下载到我保存所有我安装的软件的目录中:/home/ely/Software/Boost/boost_1_49_0/

我希望将 Boost 的东西安装到目录 /usr/include/boost_1_49/ 中,所以我使用以下命令:

 $ ./bootstrap.sh --prefix=/usr/include/boost_1_49 --libdir=/usr/include/boost_1_49/lib
 $ ./bjam variant=release link=shared install

第一个命令需要一些时间,但似乎成功并且没有产生错误。第二个命令需要更长的时间,然后始终输出如下内容:

 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/stdexcept for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/iomanip for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/new for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/fstream for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/set for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/locale for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/string for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/limits for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/complex for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/queue for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/stack for lack of /usr/include/boost_1_49/include/boost...
 ...skipped <p/usr/include/boost_1_49/include/boost>tr1/tr1/unordered_set for lack of /usr/include/boost_1_49/include/boost...

在所有这些跳过的底部,它总是说:

 ...failed updating 28 targets...
 ...skipped 9778 targets...

我反复检查了生成的项目文件project-config.jam,它列出了变量prefixexec-prefixlibdirincludedir的正确路径名,所以我不认为.jam 文件是问题所在。

我还认为在/usr/include 中创建文件夹可能是权限问题。所以我将/usr/include/boost_1_49 chmod 为777,再次尝试了这些命令,得到了相同的结果。

有没有人知道如何解决这个问题,以及最终如何安装 Boost 以便可以在 /usr/include/boost_1_49/ 中找到文件?

已添加

如果我只是直接将 tar 文件放入我想要的目录 /usr/include.boost_1_49,那么安装过程会成功完成,没有所有的跳过,它会告诉我以下信息:

 The Boost C++ Libraries were successfully built!

 The following directory should be added to compiler include paths:

     /usr/include/boost_1_49

 The following directory should be added to linker library paths:

     /usr/include/boost_1_49/stage/lib

但是,即使将这些添加到我使用的适当的 .conf 文件中,并发出 sudo ldconfig 以刷新路径后,我在尝试包含 Boost 内容时仍会出错。例如,如果我尝试包含文件 boost/math/distributions.hpp,则会收到错误消息:

/usr/include/boost_1_49/boost/math/distributions.hpp:25: fatal error: boost/math/distributions/geometric.hpp: No such file or directory

我手动验证了geometric.hpp 文件位于正确的位置,它只是看不到它。我猜distributions.hpp 中的所有#include &lt;boost...&gt; 行都没有正确识别/usr/include/boost_1_49 中的版本,但我不知道为什么它们不是或如何更改它们。

【问题讨论】:

    标签: c++ boost installation


    【解决方案1】:

    我遇到了同样的问题,直到我意识到我用来运行 bjam 命令的用户名没有写入/usr/include 目录的权限。

    你需要运行 bjam 命令为:

    sudo ./bjam --your-options--
    

    【讨论】:

    • 如果您使用sudo 强制在/usr 下方写入,则您做错了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多