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

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

最近在跑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

error1boost::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 3error: 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 5error: 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哦~

有问题欢迎留言

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: Ubuntu