Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)

最近在跑ORB_SLAM2_SSD_Semantic-master,出现了很多错误,后来发现是pcl的版本不对,我刚开始安装的是pcl-1.12,发现pcl::EuclideanClusterComparator模块进行了调整,之前的pcl中EuclideanClusterComparator有三个参数,而pcl-1.12版本中只有两个参数(行吧。。。行吧。。。)所以选择安装pcl-1.8……话不多说,我们开始。。。

首先进行下载:https://github.com/PointCloudLibrary/pcl/releases

这里我们选择1.8.0版本

进入根目录进行编译:

mkdir build
cd build
cmake ..
make -j12

error1:boost::math::isnan

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第1张图片

解决:在vlp_grabber.h文件中加入#include

error 2:#include

 原因:sha1.hpp的路径不对(查找自己电脑上sha1.hpp的路径)

解决:在pcl_visualizer.cpp中将#include 改为#include

error 3:error: invalid initialization of reference of type ‘const std::vector&’ from expression of type ‘const boost::shared_ptr >’
  144 |         return (plane_coeff_d_);

 解决:在plane_coefficient_comparator.h中的return (plane_coeff_d_)修改为

return (* plane_coeff_d_)

error 4:/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_resetStreamHC'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_setStreamDecode'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe_continue'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_compress_HC_continue'

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第2张图片

解决:/pcl/build/kdtree/CMakeFiles/pcl_kdtree.dir/下的link.txt里在末尾写上:-llz4

error 5:error: no matching function for call to ‘boost::uuids::random_generator_pure::random_generator_pure(boost::random::mt19937*)’ 77 |     boost::uuids::random_generator OutofcoreOctreeDiskContainer::uuid_gen_ (&rand_gen_);

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第3张图片

 解决:注释octree_disk_container.hpp中的76、77行:

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第4张图片

error 6:/home/young/pcl-1.8.0/features/include/pcl/features/integral_image_normal.h:254: undefined reference to `pcl::IntegralImageNormalEstimation::initData()'

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第5张图片

 解决:在octree_disk_container.hpp加入#include

error 7:/bin/ld: ../lib/libpcl_recognition.so.1.8.0: undefined reference to `pcl::BOARDLocalReferenceFrameEstimation::computeFeature(pcl::PointCloud&)'

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第6张图片

 解决:在pcl-1.8.0/features/include/pcl/features/board.h#include

终于!!!!!!成功了!!!!!!(我直接落泪~~~~)

Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_第7张图片

 完结~~撒花~~~!!!

呼呼~~~

最后,别忘了sudo make install哦~

有问题欢迎留言!

你可能感兴趣的:(SLAM,c++,开发语言,ubuntu,人工智能)