Ubuntu16.04安装pcl及常见问题
安装pcl
安装依赖
将下面的代码做成sh文件
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
比如
1 、
sudo gedit install.sh
将上面的代码复制进去,保存。
2、
执行 sudo sh install.sh
3、
询问时通通 y 回车
安装库
sudo apt-get install libpcl-dev
sudo apt-get install pcl-tools
joinMap程序错误解决
[ 50%] Building CXX object CMakeFiles/joinMap.dir/joinMap.cpp.o
[100%] Linking CXX executable joinMap
/usr/bin/ld: 找不到 -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:352: recipe for target ‘joinMap’ failed
make[2]: *** [joinMap] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/joinMap.dir/all’ failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
缺少 -lvtkproj4
所以在终端执行
sudo apt-get install lvtkproj4
发现
最后
参考 大神链接(感谢大神)
https://blog.csdn.net/danmeng8068/article/details/77341532
解决方法,需要在joinMap目录下的CMakelists.txt中加一条指令修复,即在add_executable语句前面加上
list(REMOVE_ITEM PCL_LIBRARIES “vtkproj4”)
部分内容如下
list(REMOVE_ITEM PCL_LIBRARIES “vtkproj4”)
add_executable( joinMap joinMap.cpp )
target_link_libraries( joinMap ${OpenCV_LIBS} ${PCL_LIBRARIES} )
再次编译问题解决