1. DSO missing from command line
- 原因:https://blog.csdn.net/shangzh/article/details/49079685
- 解决:CMakeLists.txt link libs中加
set(DEP_LIBS ${DEP_LIBS} libpcl_kdtree.so.1.8)
set(DEP_LIBS ${DEP_LIBS} libpcl_common.so.1.8)
2. 未定义的引用
对‘pcl::search::KdTree<pcl::PointXYZINormal, pcl::KdTreeFLANN<pcl::PointXYZINormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZINormal> const> const&)’未定义的引用对‘pcl::search::KdTree<pcl::PointXYZINormal, pcl::KdTreeFLANN<pcl::PointXYZINormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZINormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)’未定义的引用
- 在出问题的cpp文件中加
#include <pcl/search/impl/kdtree.hpp>
#include <pcl/kdtree/impl/kdtree_flann.hpp>
#include <pcl/filters/impl/random_sample.hpp>
#include <pcl/filters/impl/statistical_outlier_removal.hpp>
https://www.its404.com/article/weixin_42718092/94874997
https://stackoverflow.com/questions/44253353/linker-errors-with-pcl-1-8-0-project