本文主要是介绍在编译pcl中octree官方提供代码示例时报错undefined reference to `pcl::octree::OctreePointCloud问题解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在编译octree官方提供代码示例时出现很多undefined reference to...如下所示:
/usr/bin/ld: CMakeFiles/octree_change_detection.dir/octree_change_detection.cpp.o: in function `main':
octree_change_detection.cpp:(.text+0x2ca): undefined reference to `pcl::octree::OctreePointCloud<pcl::PointXYZ, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty> >::addPointsFromInputCloud()'
/usr/bin/ld: octree_change_detection.cpp:(.text+0x2d9): undefined reference to `pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty>::switchBuffers()'
解决办法:
查看报错信息添加对应的.h和.cpp文件
最终编译成功。
如果还不能解决问题,那就重装pcl吧,尽量安装低版本一些。
在运行range image官方demo时也出现一大堆undefined,最后是通过将pcl1.12.0卸载了,重装pcl1.9.1问题得到了解决。
这篇关于在编译pcl中octree官方提供代码示例时报错undefined reference to `pcl::octree::OctreePointCloud问题解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!