如果你对PCL版本没有要求可以根据下面的方式安装:
sudo apt-get install libpcl-dev
编译工程的时候可能会出现两个错误:
1.
*** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'pcl_test'. Stop
解决方式:
sudo ln -s /usr/lib/x86_64-linux-gnu/libproj.so.9 /usr/lib/x86_64-linux-gnu/libproj.so
原因是没有找到相应的库
我们可以按照错位的位置去查找相应的库,然后建立软链接,如果没有相应库,可以通过apt-get install安装
2.
/usr/bin/ld: cannot find -lvtkproj4
解决方式:
sudo ln -s /usr/lib/libvtkproj4.so.5.10 /usr/lib/libvtkproj4.so
通过源码安装
先要安装相应的依赖
sudo apt-get update
sudo apt-get install git build-essential linux-libc-dev
sudo apt-get install cmake cmake-gui
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libflann1.8 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libvtk5.10-qt4 libvtk5.10 libvtk5-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mono-complete
sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre
然后下载源码:
git clone https://github.com/PointCloudLibrary/pcl.git
然后编译和安装:
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make
安装:
sudo make install
参考博客:
原文链接:https://blog.csdn.net/WEICHUAN1107/article/details/87688374