c++ - Boost 编译点云库时出现的问题

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

我正在尝试从 OSX 10.6.8 上的源代码编译点云库,但我一直在使用 Boost 库时遇到同样的错误:

! make
Linking CXX shared library ../lib/libpcl_common.dylib
Undefined symbols:
  "boost::thread::start_thread_noexcept()", referenced from:
  boost::thread::thread<boost::_bi::bind_t<void, boost::_mfi::mf0<void, 

pcl::TimeTrigger>, boost::_bi::list1<boost::_bi::value<pcl::TimeTrigger*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, pcl::TimeTrigger>, boost::_bi::list1<boost::_bi::value<pcl::TimeTrigger*> > >, boost::disable_if_c<boost::thread_detail::is_convertible<boost::_bi::bind_t<void, boost::_mfi::mf0<void, pcl::TimeTrigger>, boost::_bi::list1<boost::_bi::value<pcl::TimeTrigger*> > >&, boost::detail::thread_move_t<boost::_bi::bind_t<void, boost::_mfi::mf0<void, pcl::TimeTrigger>, boost::_bi::list1<boost::_bi::value<pcl::TimeTrigger*> > > > >::value, boost::thread::dummy*>::type)in time_trigger.cpp.o
  "boost::thread::join_noexcept()", referenced from:
      pcl::TimeTrigger::~TimeTrigger()in time_trigger.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [lib/libpcl_common.1.7.0.dylib] Error 1
make[1]: *** [common/CMakeFiles/pcl_common.dir/all] Error 2
make: *** [all] Error 2

我查看了 CMake 选项,它们似乎都没有引用 Boost 库 并激活了高级设置,我发现我的 boost 库文件位于 /usr/lib/;例如/usr/lib/libboost_date_time-mt.dylib:

enter image description here

我该怎么做才能解决这个问题?将来我可以做些什么来帮助防止类似问题再次发生?


更新 我已经从头开始重建和编译 Boost,但仍然遇到同样的错误。这看起来很奇怪,因为 Boost 是从头开始编译的,而 PCL 也是。唯一值得注意的是在 CMake 输出中,我收到了这个奇怪的冲突消息:

-- checking for module 'eigen3'
--   package 'eigen3' not found
-- Eigen found (include: /usr/local/include/eigen3)

最佳答案

这是“老版本的 boost”问题吗?

也许链接器正在寻找只存在于较新版本的 boost 中的函数,而不是您构建和安装的版本。

仔细检查点云库推荐的 boost 版本,以及您拥有的 boost 版本。

关于c++ - Boost 编译点云库时出现的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16449887/

相关文章:

c++ - QML:多次按下/释放后某些键未处理

android - 使用 FFmpeg 编码时处理原始数据的正确方法

c++ - boost Spirit X3 中的上下文是什么?

c++ - Boost Hana any_of?

c++ - 仅当 CMake 中的 header 更改时才重新链接共享库

c++ - Visual Studio + CMake 的 GLOB_RECURSE

c++ - 使用大括号括起来的初始化列表初始化一个类

c++如何处理循环依赖?

c++ - xutility(2227) : warning C4996: 'std::_Copy_impl'

python - 在Caffe2上启用多线程