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

解决:在vlp_grabber.h文件中加入#include<boost/math/special_functions/fpclassify.hpp>

error 2:#include <boost/uuid/sha1.hpp>

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

解决:在pcl_visualizer.cpp中将#include <boost/uuid/sha1.hpp>改为#include <boost/uuid/detail/sha1.hpp>

error 3:error: invalid initialization of reference of type ‘const std::vector<float>&’ from expression of type ‘const boost::shared_ptr<std::vector<float> >’
  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'

解决:/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<PointT>::uuid_gen_ (&rand_gen_);

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

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

 解决:在octree_disk_container.hpp加入#include <pcl/features/normal_3d.h>

error 7:/bin/ld: ../lib/libpcl_recognition.so.1.8.0: undefined reference to `pcl::BOARDLocalReferenceFrameEstimation<pcl::PointXYZRGBA, pcl::Normal, pcl::ReferenceFrame>::computeFeature(pcl::PointCloud<pcl::ReferenceFrame>&)'

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

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

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

呼呼~~~

最后,别忘了sudo make install哦~

有问题欢迎留言!

  • 55
    点赞
  • 138
    收藏
    觉得还不错? 一键收藏
  • 34
    评论
评论 34
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值