pcl 中/usr/bin/ld: 找不到 -lFLANN::FLANN

在运行pcl的Cluster Recognition and 6DOF Pose Estimation程序时,遇到cmake和make过程中的错误提示。通过降低pcl版本并修改CMakeLists.txt文件,解决了-lFLANN::FLANN找不到的问题。之后又出现DSO missing from command line错误,通过添加libmpi_cxx.so到CMakeLists.txt成功编译。最后,执行程序并按照官方指南运行bash文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近在运行pcl官网的 Cluster Recognition and 6DOF Pose Estimation using VFH descriptors 程序时,分别在cmake …和 make的过程中出现了以下警告和错误:

cmake …后
在这里插入图片描述
make 后
在这里插入图片描述

解决方案:

询问了师兄后,师兄说这个版本和他之前的版本不太一样,可能是对应着pcl 1.9,所以从网上找了一版之前的版本进行调试。
链接如下:https://blog.youkuaiyun.com/shengxiamei/article/details/47132511

将其中的CMakeLists.txt文件进行了改动find_package(PCL 1.8 REQUIRED)后,运行࿰

[100%] Built target ego_planner_node /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerate()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:152: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerateCylinder()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:269: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x10): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x28): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' collect2: error: ld returned 1 exit status make[2]: *** [uav_simulator/map_generator/CMakeFiles/random_forest.dir/build.make:329:/home/dxinl/Fast-Drone-250/devel/lib/map_generator/random_forest]
03-13
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值