【问题标题】:Linking to boost libraries when building pcl-1.7.1 from source从源代码构建 pcl-1.7.1 时链接到 boost 库
【发布时间】:2014-03-17 02:35:04
【问题描述】:

我从 github 下载了 pcl-1.7.1 版本,并尝试使用

构建代码
cd PCL-1.6.0 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. 
make
sudo make install

cmake 命令运行成功,并写下有关 boost

-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams

问题来自 make 命令,一段时间后返回以下错误:

    Scanning dependencies of target pcl_convert_pcd_ascii_binary
    [ 12%] Building CXX object io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o
    Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary
    ../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::join_noexcept()'
    ../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::start_thread_noexcept()'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::permissions(boost::filesystem::path const&, boost::filesystem::perms, boost::system::error_code*)'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::extension() const'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::dir_itr_close(void*&, void*&)'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::stem() const'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*)'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::directory_entry::m_get_status(boost::system::error_code*) const'
    ../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::thread::do_try_join_until_noexcept(timespec const&, bool&)'
    collect2: ld returned 1 exit status
    make[2]: *** [bin/pcl_convert_pcd_ascii_binary] Error 1
    make[1]: *** [io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/all] Error 2
    make: *** [all] Error 2

这是一个链接问题是否正确?会不会是 boost 安装导致了问题?

我通过在 boost_1_55_0 目录中执行以下命令从源代码(版本 1.55.0)构建了 boost 库

sudo ./bootstrap
sudo ./b2 install

然后将 boost 安装在 /usr/local/include 和 /usr/local/lib 中

我使用 32 位 Ubuntu 12.04

【问题讨论】:

  • 这是一个链接问题。要查看链接器尝试运行的命令以及它引入的库,请在运行 make 时像这样运行它:VERBOSE=1 make
  • 我遇到了一个类似这样的问题,但我不记得我是如何解决的。这可能是多个版本的 boost 的问题。也尝试运行ccmake,而不是cmake

标签: c++ boost point-cloud-library


【解决方案1】:

我在 /usr/lib 中发现了一些 libboost 文件,我忘记从上次安装的 boost 中删除这些文件(正如 @D.J.Duff 所指出的那样)。删除这些文件并再次安装 boost 解决了这个问题。

【讨论】:

    猜你喜欢
    • 2021-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-13
    相关资源
    最近更新 更多