从源代码构建pcl-1.7.1时链接到boost库

时间:2014-03-12 20:51:57

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

我从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_1_55_0目录中执行以下内容,从源代码(版本1.55.0)构建了boost库

sudo ./bootstrap
sudo ./b2 install

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

我使用32位Ubuntu 12.04

1 个答案:

答案 0 :(得分:2)

我在/ usr / lib中找到了一些libboost文件,我忘记从上次安装的boost中删除(正如@ D.J.Duff所指出的)。删除这些文件并再次安装boost会修复问题。