1,清理QT防止冲突
sudo apt-get autoremove --purge libqt*
2,安装依赖
touch install_pcl_dependences.sh
写入
sudo apt-get update
sudo apt-get install libboost-all-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libflann1.8 libflann-dev
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 libqhull* libgtest-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libxt-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install mono-complete
sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libopenni-dev
sudo apt-get install libopenni2-dev
执行sudo sh install_pcl_dependences.sh
3,安装QT5.5 https://download.qt.io/archive/qt/5.5/5.5.1/
安装细节为https://www.jianshu.com/p/7dad1a4483bd
4,安装VTK6.3 https://vtk.org/download/
mkdir build &&cd build
cmake-gui
(1)选VTK_Group_Qt选项
(2)将CMAKE_BUILD_TYPE改为Release
(3)VTK_QT_VERSION改为5
(4)按下Configure按钮,
手动填上Qt5_DIR的地址,地址要精确到Qt5Config.cmake所在文件夹。
我的是 /home/amax/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5
(5)按下Gennrate按钮
(6)配置完成后,进行编译安装
配置好后,make -j16 编译,VTK编译速度还可以,等一会就可以了
编译好后,sudo make install将库安装。
此时vtk的头文件应该都在/usr/local/include/vtk-6.3
库文件都在/usr/local/lib中。
编译VTK的库最主要的原因还是需要libQVTKWidgetPlugin.so库文件,路径为/home/username/VTK-6.3.0/build/lib。讲这个文件复制到(qt安装路径)/Tools/QtCreator/bin/plugins/designer(需要用sudo cp 命令来复制)
此时打开QT的UI界面,便会出现QVTK的控件
5,PCL安装
mkdir build &&cd build
cmake-gui
vtkDataArrayPrivate.txx: No such file or directory
cd VTK/VTK-6.3.0/Common/Core
sudo cp vtkDataArrayPrivate.txx /usr/local/include/
make -j16
sudo make install
完成