查看与pcl有关的库
dpkg -l | grep pcl
查看libpcl-dev库所在位置
dpkg -L libpcl-dev
查看libpcl的版本
apt-show-versions | grep libpcl
由于安装了noetic 所以自带了pcl-1.10
其库文件位于/usr/include/pcl-1.10/pcl/
其cmake相关文件/usr/share/doc/libpcl-dev/
多版本安装pcl1.8.0
pcl安装在位置/usr/local/pcl-1.8.0/pcl
pcl1.8.0下载地址
https://github.com/PointCloudLibrary/pcl/tree/pcl-1.8.0
参考安装方法
https://blog.csdn.net/weixin_44401286/article/details/113695219
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/pcl-1.8.0/pcl \ -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \..
make -j4
sudo make install
编译过程出错
问题二、四需要修改编译中产生的文件,要等到编译报错之后再改。其余可以提前改
问题一 error :#include <boost/uuid/sha1.hpp>
参考文中对应error2部分
https://blog.csdn.net/fffyyyhhh12/article/details/126889810#t6
问题二 报错LZ4_有关的
make[2]: *** [tools/CMakeFiles/pcl_compute_cloud_error.dir/build.make:283: bin/pcl_compute_cloud_err
参考以下链接中的 1报错内容:
https://blog.csdn.net/weixin_44684139/article/details/112516620
或者参考erro4
https://blog.csdn.net/fffyyyhhh12/article/details/126889810#t6
error: no matching function for call to ‘boost::uuids::random_generator_pure::random_generator_pure(boost::random::mt19937*)’
boost::uuids::random_generator OutofcoreOctreeDiskContainer<PointT>::uuid_gen_ (&rand_gen_);
问题三 OutofcoreOctreeDiskContainer
参考文中对应error5部分https://blog.csdn.net/fffyyyhhh12/article/details/126889810#t6
问题四 pcl_feature_matching
make[2]: *** [apps/CMakeFiles/pcl_feature_matching.dir/build.make:291: bin/pcl_feature_matching] Error 1
make[1]: *** [CMakeFiles/Makefile2:3754: apps/CMakeFiles/pcl_feature_matching.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
参考链接下面链接的 问题6:
https://blog.csdn.net/dui845819593/article/details/128486864
查找
whereis liblz4.so
wxh@wxh-com:~/cmake_lib/pcl-pcl-1.8.0/build$ whereis liblz4.so
liblz4: /usr/lib/x86_64-linux-gnu/liblz4.so /usr/lib/x86_64-linux-gnu/liblz4.a
将/usr/lib/x86_64-linux-gnu/liblz4.a 添加到txt文件的内容的末尾
/home/wxh/cmake_lib/pcl-pcl-1.8.0/build/apps/CMakeFiles/pcl_feature_matching.dir/link.txt
终于可以了,然后
sudo make install
2、多版本使用
https://blog.csdn.net/weixin_44401286/article/details/113695219
使用时,在工程的CMakeLists.txt中需要指定使用哪个版本的PCL,如下方式:
set(PCL_DIR "/usr/local/pcl-1.8.0/pcl/share/pcl-1.8")
find_package(PCL 1.8 REQUIRED)