PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置

写在前面:最近由于毕业论文三维点云相关项目需要,得学习PCL库相关知识,作为小白的我,配置PCL库和QT花了很长时间,为了造福后者,我讲下相应过程以及遇到的问题,以帮助小白少走弯路。后续会写一些PCL相关学习的文章,以记录学习过程并交流。

1、PCL 1.8.1配置

(1)安装

首先,下载PCL1.8.1库安装文件PCL-1.8.1-AllInOne-msvc2017-win64.exe ,pcl-1.8.1-pdb-msvc2017-win64.zip
这里要说明下,我是win10 64-bit系统,然后VS2017环境配置,所以请32位或者VS2015下载对应版本。这里还要说下,allinone版本是可以直接安装的(包含了很多第三方编译包,其中包括VTK,那为什么还要安装VTK呢,这是后话)PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第1张图片

安装过程:
首先点击下载好的.exe文件,进行安装,点击如图所示add path,自动添加路径,然后点击下一步
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第2张图片
再改掉安装路径,可以设置自己的安装路径(但是千万要注意,不要用中文安装路径,不要用中文,不要用中文,重要的话说三遍,后面VTK用CMAKE,cmake不识别中文,所以用英文)
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第3张图片
随后再将如图所示的第三方安装包都勾选上
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第4张图片
之后会等待一段时间安装,接下来安装第三方的库函数的时候记住要在自己选定的安装路径下安装  比如我是安装在D盘下,所以当提示安装openni的时候我们需要给
opneni更改到自己选定的安装PCL的第三方库安装的路径下即,D:\Program Files\PCL1.8.1\3rdparty\OpenNI2,然后同意安装PrimerSense
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第5张图片
然后就安装好了
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第6张图片
安装过后可能会提示你路径太长,添加不了之类的错误提示,不用管,接下来配置就好了

(2)配置变量

由于我们勾选了Add PCL to system PATH for all users,安装好后,系统变量里会自动出现如下图所示的几个变量

PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第7张图片
然后还需要在系统变量的PATH变量中添加如下内容:%PCL_ROOT\bin;%PCL_ROOT%\3rdParty\VTK\bin;%PCL_ROOT\3rdParty\FLANN\bin;%OPENNI2_REDIST64%;%PCL_ROOT%\3rdParty\Qhull\bin;%PCL_ROOT%\3rdParty\OpenNI2\Tools
然后重启电脑使变量生效。
最后解压PCL-1.8.1-pdb-msvc2017-win64.zip,将里面的pdb文件全部复制到PCL安装路径下bin文件夹中;

(3)VS2017环境下配置PCL1.8.1

  1. debug配置

新建一个空项目,将项目设置成64位。
切换属性管理器,在Debug|64下添加新项目属性表,取名PCL。
左侧点VC++目录,右侧包含目录添加:
D:\Program Files\PCL 1.8.1\3rdParty\OpenNI2\Include;D:\Program Files\PCL 1.8.1\include\pcl-1.8;D:\Program Files\PCL 1.8.1\3rdParty\VTK\include\vtk-8.0;D:\Program Files\PCL 1.8.1\3rdParty\QHull\include;D:\Program Files\PCL 1.8.1\3rdParty\FLANN\include;D:\Program Files\PCL 1.8.1\3rdParty\Eigen\eigen3;D:\Program Files\PCL 1.8.1\3rdParty\Boost\include\boost-1_64;

右侧库目录添加:
D:\Program Files\PCL 1.8.1\3rdParty\OpenNI2\Lib;D:\Program Files\PCL 1.8.1\3rdParty\VTK\lib;D:\Program Files\PCL 1.8.1\3rdParty\Qhull\lib;D:\Program Files\PCL 1.8.1\3rdParty\FLANN\lib;D:\Program Files\PCL 1.8.1\3rdParty\Boost\lib;D:\Program Files\PCL 1.8.1\lib;
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第8张图片
左侧点链接器,再点输入,找到附加依赖项,添加如下(最后额外添加一个opengl32.lib的库,不然会报错,大概158个链接错误,评论区有出现过):
vtknetcdf_c+±gd.lib;pcl_common_debug.lib;pcl_features_debug.lib;pcl_filters_debug.lib;pcl_io_ply_debug.lib;pcl_io_debug.lib;pcl_kdtree_debug.lib;pcl_keypoints_debug.lib;pcl_ml_debug.lib;pcl_octree_debug.lib;pcl_outofcore_debug.lib;pcl_people_debug.lib;pcl_recognition_debug.lib;pcl_registration_debug.lib;pcl_sample_consensus_debug.lib;pcl_search_debug.lib;pcl_segmentation_debug.lib;pcl_stereo_debug.lib;pcl_surface_debug.lib;pcl_tracking_debug.lib;pcl_visualization_debug.lib;libboost_atomic-vc141-mt-gd-1_64.lib;libboost_bzip2-vc141-mt-gd-1_64.lib;libboost_chrono-vc141-mt-gd-1_64.lib;libboost_container-vc141-mt-gd-1_64.lib;libboost_context-vc141-mt-gd-1_64.lib;libboost_coroutine-vc141-mt-gd-1_64.lib;libboost_date_time-vc141-mt-gd-1_64.lib;libboost_exception-vc141-mt-gd-1_64.lib;libboost_fiber-vc141-mt-gd-1_64.lib;libboost_filesystem-vc141-mt-gd-1_64.lib;libboost_graph-vc141-mt-gd-1_64.lib;libboost_graph_parallel-vc141-mt-gd-1_64.lib;libboost_iostreams-vc141-mt-gd-1_64.lib;libboost_locale-vc141-mt-gd-1_64.lib;libboost_log-vc141-mt-gd-1_64.lib;libboost_log_setup-vc141-mt-gd-1_64.lib;libboost_math_c99-vc141-mt-gd-1_64.lib;libboost_math_c99f-vc141-mt-gd-1_64.lib;libboost_math_c99l-vc141-mt-gd-1_64.lib;libboost_math_tr1-vc141-mt-gd-1_64.lib;libboost_math_tr1f-vc141-mt-gd-1_64.lib;libboost_math_tr1l-vc141-mt-gd-1_64.lib;libboost_mpi-vc141-mt-gd-1_64.lib;libboost_numpy3-vc141-mt-gd-1_64.lib;libboost_numpy-vc141-mt-gd-1_64.lib;libboost_prg_exec_monitor-vc141-mt-gd-1_64.lib;libboost_program_options-vc141-mt-gd-1_64.lib;libboost_python3-vc141-mt-gd-1_64.lib;libboost_python-vc141-mt-gd-1_64.lib;libboost_random-vc141-mt-gd-1_64.lib;libboost_regex-vc141-mt-gd-1_64.lib;libboost_serialization-vc141-mt-gd-1_64.lib;libboost_signals-vc141-mt-gd-1_64.lib;libboost_system-vc141-mt-gd-1_64.lib;libboost_test_exec_monitor-vc141-mt-gd-1_64.lib;libboost_thread-vc141-mt-gd-1_64.lib;libboost_timer-vc141-mt-gd-1_64.lib;libboost_type_erasure-vc141-mt-gd-1_64.lib;libboost_unit_test_framework-vc141-mt-gd-1_64.lib;libboost_wave-vc141-mt-gd-1_64.lib;libboost_wserialization-vc141-mt-gd-1_64.lib;libboost_zlib-vc141-mt-gd-1_64.lib;flann-gd.lib;flann_cpp-gd.lib;flann_cpp_s-gd.lib;flann_s-gd.lib;qhull_d.lib;qhullcpp_d.lib;qhullstatic_d.lib;qhullstatic_r_d.lib;qhull_p_d.lib;qhull_r_d.lib;vtkalglib-8.0-gd.lib;vtkChartsCore-8.0-gd.lib;vtkCommonColor-8.0-gd.lib;vtkCommonComputationalGeometry-8.0-gd.lib;vtkCommonCore-8.0-gd.lib;vtkCommonDataModel-8.0-gd.lib;vtkCommonExecutionModel-8.0-gd.lib;vtkCommonMath-8.0-gd.lib;vtkCommonMisc-8.0-gd.lib;vtkCommonSystem-8.0-gd.lib;vtkCommonTransforms-8.0-gd.lib;vtkDICOMParser-8.0-gd.lib;vtkDomainsChemistry-8.0-gd.lib;vtkexoIIc-8.0-gd.lib;vtkexpat-8.0-gd.lib;vtkFiltersAMR-8.0-gd.lib;vtkFiltersCore-8.0-gd.lib;vtkFiltersExtraction-8.0-gd.lib;vtkFiltersFlowPaths-8.0-gd.lib;vtkFiltersGeneral-8.0-gd.lib;vtkFiltersGeneric-8.0-gd.lib;vtkFiltersGeometry-8.0-gd.lib;vtkFiltersHybrid-8.0-gd.lib;vtkFiltersHyperTree-8.0-gd.lib;vtkFiltersImaging-8.0-gd.lib;vtkFiltersModeling-8.0-gd.lib;vtkFiltersParallel-8.0-gd.lib;vtkFiltersParallelImaging-8.0-gd.lib;vtkFiltersPoints-8.0-gd.lib;vtkFiltersProgrammable-8.0-gd.lib;vtkFiltersSelection-8.0-gd.lib;vtkFiltersSMP-8.0-gd.lib;vtkFiltersSources-8.0-gd.lib;vtkFiltersStatistics-8.0-gd.lib;vtkFiltersTexture-8.0-gd.lib;vtkFiltersTopology-8.0-gd.lib;vtkFiltersVerdict-8.0-gd.lib;vtkfreetype-8.0-gd.lib;vtkGeovisCore-8.0-gd.lib;vtkgl2ps-8.0-gd.lib;vtkhdf5-8.0-gd.lib;vtkhdf5_hl-8.0-gd.lib;vtkImagingColor-8.0-gd.lib;vtkImagingCore-8.0-gd.lib;vtkImagingFourier-8.0-gd.lib;vtkImagingGeneral-8.0-gd.lib;vtkImagingHybrid-8.0-gd.lib;vtkImagingMath-8.0-gd.lib;vtkImagingMorphological-8.0-gd.lib;vtkImagingSources-8.0-gd.lib;vtkImagingStatistics-8.0-gd.lib;vtkImagingStencil-8.0-gd.lib;vtkInfovisCore-8.0-gd.lib;vtkInfovisLayout-8.0-gd.lib;vtkInteractionImage-8.0-gd.lib;vtkInteractionStyle-8.0-gd.lib;vtkInteractionWidgets-8.0-gd.lib;vtkIOAMR-8.0-gd.lib;vtkIOCore-8.0-gd.lib;vtkIOEnSight-8.0-gd.lib;vtkIOExodus-8.0-gd.lib;vtkIOExport-8.0-gd.lib;vtkIOExportOpenGL-8.0-gd.lib;vtkIOGeometry-8.0-gd.lib;vtkIOImage-8.0-gd.lib;vtkIOImport-8.0-gd.lib;vtkIOInfovis-8.0-gd.lib;vtkIOLegacy-8.0-gd.lib;vtkIOLSDyna-8.0-gd.lib;vtkIOMINC-8.0-gd.lib;vtkIOMovie-8.0-gd.lib;vtkIONetCDF-8.0-gd.lib;vtkIOParallel-8.0-gd.lib;vtkIOParallelXML-8.0-gd.lib;vtkIOPLY-8.0-gd.lib;vtkIOSQL-8.0-gd.lib;vtkIOTecplotTable-8.0-gd.lib;vtkIOVideo-8.0-gd.lib;vtkIOXML-8.0-gd.lib;vtkIOXMLParser-8.0-gd.lib;vtkjpeg-8.0-gd.lib;vtkjsoncpp-8.0-gd.lib;vtklibharu-8.0-gd.lib;vtklibxml2-8.0-gd.lib;vtklz4-8.0-gd.lib;vtkmetaio-8.0-gd.lib;vtkNetCDF-8.0-gd.lib;vtkoggtheora-8.0-gd.lib;vtkParallelCore-8.0-gd.lib;vtkpng-8.0-gd.lib;vtkproj4-8.0-gd.lib;vtkRenderingAnnotation-8.0-gd.lib;vtkRenderingContext2D-8.0-gd.lib;vtkRenderingContextOpenGL-8.0-gd.lib;vtkRenderingCore-8.0-gd.lib;vtkRenderingFreeType-8.0-gd.lib;vtkRenderingGL2PS-8.0-gd.lib;vtkRenderingImage-8.0-gd.lib;vtkRenderingLabel-8.0-gd.lib;vtkRenderingLIC-8.0-gd.lib;vtkRenderingLOD-8.0-gd.lib;vtkRenderingOpenGL-8.0-gd.lib;vtkRenderingVolume-8.0-gd.lib;vtkRenderingVolumeOpenGL-8.0-gd.lib;vtksqlite-8.0-gd.lib;vtksys-8.0-gd.lib;vtktiff-8.0-gd.lib;vtkverdict-8.0-gd.lib;vtkViewsContext2D-8.0-gd.lib;vtkViewsCore-8.0-gd.lib;vtkViewsInfovis-8.0-gd.lib;vtkzlib-8.0-gd.lib;opengl32.lib(最后要加上opengl32.lib)

  1. Release配置

切换属性管理器,在Release|64下添加新项目属性表,取名PCL_Release。
库配置相同,链接如下所示:

vtknetcdf_c++.lib
pcl_common_release.lib
pcl_features_release.lib
pcl_filters_release.lib
pcl_io_ply_release.lib
pcl_io_release.lib
pcl_kdtree_release.lib
pcl_keypoints_release.lib
pcl_ml_release.lib
pcl_octree_release.lib
pcl_outofcore_release.lib
pcl_people_release.lib
pcl_recognition_release.lib
pcl_registration_release.lib
pcl_sample_consensus_release.lib
pcl_search_release.lib
pcl_segmentation_release.lib
pcl_stereo_release.lib
pcl_surface_release.lib
pcl_tracking_release.lib
pcl_visualization_release.lib
libboost_atomic-vc141-mt-1_64.lib
libboost_bzip2-vc141-mt-1_64.lib
libboost_chrono-vc141-mt-1_64.lib
libboost_container-vc141-mt-1_64.lib
libboost_context-vc141-mt-1_64.lib
libboost_coroutine-vc141-mt-1_64.lib
libboost_date_time-vc141-mt-1_64.lib
libboost_exception-vc141-mt-1_64.lib
libboost_fiber-vc141-mt-1_64.lib
libboost_filesystem-vc141-mt-1_64.lib
libboost_graph-vc141-mt-1_64.lib
libboost_graph_parallel-vc141-mt-1_64.lib
libboost_iostreams-vc141-mt-1_64.lib
libboost_locale-vc141-mt-1_64.lib
libboost_log-vc141-mt-1_64.lib
libboost_log_setup-vc141-mt-1_64.lib
libboost_math_c99-vc141-mt-1_64.lib
libboost_math_c99f-vc141-mt-1_64.lib
libboost_math_c99l-vc141-mt-1_64.lib
libboost_math_tr1-vc141-mt-1_64.lib
libboost_math_tr1f-vc141-mt-1_64.lib
libboost_math_tr1l-vc141-mt-1_64.lib
libboost_mpi-vc141-mt-1_64.lib
libboost_numpy3-vc141-mt-1_64.lib
libboost_numpy-vc141-mt-1_64.lib
libboost_prg_exec_monitor-vc141-mt-1_64.lib
libboost_program_options-vc141-mt-1_64.lib
libboost_python3-vc141-mt-1_64.lib
libboost_python-vc141-mt-1_64.lib
libboost_random-vc141-mt-1_64.lib
libboost_regex-vc141-mt-1_64.lib
libboost_serialization-vc141-mt-1_64.lib
libboost_signals-vc141-mt-1_64.lib
libboost_system-vc141-mt-1_64.lib
libboost_test_exec_monitor-vc141-mt-1_64.lib
libboost_thread-vc141-mt-1_64.lib
libboost_timer-vc141-mt-1_64.lib
libboost_type_erasure-vc141-mt-1_64.lib
libboost_unit_test_framework-vc141-mt-1_64.lib
libboost_wave-vc141-mt-1_64.lib
libboost_wserialization-vc141-mt-1_64.lib
libboost_zlib-vc141-mt-1_64.lib
flann.lib
flann_cpp.lib
flann_cpp_s.lib
flann_s.lib
qhull_d.lib
qhullcpp_d.lib
qhullstatic_d.lib
qhullstatic_r_d.lib
qhull_p_d.lib
qhull_r_d.lib
vtkalglib-8.0.lib
vtkChartsCore-8.0.lib
vtkCommonColor-8.0.lib
vtkCommonComputationalGeometry-8.0.lib
vtkCommonCore-8.0.lib
vtkCommonDataModel-8.0.lib
vtkCommonExecutionModel-8.0.lib
vtkCommonMath-8.0.lib
vtkCommonMisc-8.0.lib
vtkCommonSystem-8.0.lib
vtkCommonTransforms-8.0.lib
vtkDICOMParser-8.0.lib
vtkDomainsChemistry-8.0.lib
vtkexoIIc-8.0.lib
vtkexpat-8.0.lib
vtkFiltersAMR-8.0.lib
vtkFiltersCore-8.0.lib
vtkFiltersExtraction-8.0.lib
vtkFiltersFlowPaths-8.0.lib
vtkFiltersGeneral-8.0.lib
vtkFiltersGeneric-8.0.lib
vtkFiltersGeometry-8.0.lib
vtkFiltersHybrid-8.0.lib
vtkFiltersHyperTree-8.0.lib
vtkFiltersImaging-8.0.lib
vtkFiltersModeling-8.0.lib
vtkFiltersParallel-8.0.lib
vtkFiltersParallelImaging-8.0.lib
vtkFiltersPoints-8.0.lib
vtkFiltersProgrammable-8.0.lib
vtkFiltersSelection-8.0.lib
vtkFiltersSMP-8.0.lib
vtkFiltersSources-8.0.lib
vtkFiltersStatistics-8.0.lib
vtkFiltersTexture-8.0.lib
vtkFiltersTopology-8.0.lib
vtkFiltersVerdict-8.0.lib
vtkfreetype-8.0.lib
vtkGeovisCore-8.0.lib
vtkgl2ps-8.0.lib
vtkhdf5-8.0.lib
vtkhdf5_hl-8.0.lib
vtkImagingColor-8.0.lib
vtkImagingCore-8.0.lib
vtkImagingFourier-8.0.lib
vtkImagingGeneral-8.0.lib
vtkImagingHybrid-8.0.lib
vtkImagingMath-8.0.lib
vtkImagingMorphological-8.0.lib
vtkImagingSources-8.0.lib
vtkImagingStatistics-8.0.lib
vtkImagingStencil-8.0.lib
vtkInfovisCore-8.0.lib
vtkInfovisLayout-8.0.lib
vtkInteractionImage-8.0.lib
vtkInteractionStyle-8.0.lib
vtkInteractionWidgets-8.0.lib
vtkIOAMR-8.0.lib
vtkIOCore-8.0.lib
vtkIOEnSight-8.0.lib
vtkIOExodus-8.0.lib
vtkIOExport-8.0.lib
vtkIOExportOpenGL-8.0.lib
vtkIOGeometry-8.0.lib
vtkIOImage-8.0.lib
vtkIOImport-8.0.lib
vtkIOInfovis-8.0.lib
vtkIOLegacy-8.0.lib
vtkIOLSDyna-8.0.lib
vtkIOMINC-8.0.lib
vtkIOMovie-8.0.lib
vtkIONetCDF-8.0.lib
vtkIOParallel-8.0.lib
vtkIOParallelXML-8.0.lib
vtkIOPLY-8.0.lib
vtkIOSQL-8.0.lib
vtkIOTecplotTable-8.0.lib
vtkIOVideo-8.0.lib
vtkIOXML-8.0.lib
vtkIOXMLParser-8.0.lib
vtkjpeg-8.0.lib
vtkjsoncpp-8.0.lib
vtklibharu-8.0.lib
vtklibxml2-8.0.lib
vtklz4-8.0.lib
vtkmetaio-8.0.lib
vtkNetCDF-8.0.lib
vtkoggtheora-8.0.lib
vtkParallelCore-8.0.lib
vtkpng-8.0.lib
vtkproj4-8.0.lib
vtkRenderingAnnotation-8.0.lib
vtkRenderingContext2D-8.0.lib
vtkRenderingContextOpenGL-8.0.lib
vtkRenderingCore-8.0.lib
vtkRenderingFreeType-8.0.lib
vtkRenderingGL2PS-8.0.lib
vtkRenderingImage-8.0.lib
vtkRenderingLabel-8.0.lib
vtkRenderingLIC-8.0.lib
vtkRenderingLOD-8.0.lib
vtkRenderingOpenGL-8.0.lib
vtkRenderingVolume-8.0.lib
vtkRenderingVolumeOpenGL-8.0.lib
vtksqlite-8.0.lib
vtksys-8.0.lib
vtktiff-8.0.lib
vtkverdict-8.0.lib
vtkViewsContext2D-8.0.lib
vtkViewsCore-8.0.lib
vtkViewsInfovis-8.0.lib
vtkzlib-8.0.lib
opengl32.lib

2、QT5.9.6下载安装

(1)qt5.9.6下载安装
首先进入科大镜像站(因为国外网站下载速度太慢,传送门:添加链接描述)下载qt5.9.6安装包
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第9张图片
然后一步步安装下去,在下图这一步选择如图所示组件
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第10张图片
然后一步步安装下去就可以了

(2)qt5.9.6VS中配置
首先点击工具–>拓展和更新–>联机–>搜索QT–>选择Qt Visual studio tools
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第11张图片
然后点击左边的联机
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第12张图片
在右边搜索框输入QT搜索Qt Visual Studio Tools,再下载完成
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第13张图片
然后,关闭重启VS2017,然后就发现菜单栏多了QT VS Tools这一栏
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第14张图片
然后点击Qt VS Tools,点击下图选项
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第15张图片
如下图点击add
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第16张图片
点击省略号选择安装的qt下的msvc2017_64的路径
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第17张图片
这样qt在VS2017下的配置就完成了。

3、编译安装VTK

(1)下载VTK库文件
前文提到PCL安装包有编译好的VTK库,那为什么还要单独安装VTK呢?是由于预编译的vtk包并没有和qt进行编译得到QVTKWidget控件(该控件用来在qt上进行显示点云),因此需要下载VTK-8.0(必须是该版本,因为pcl-allinone包之前编译使用的是该版本
传送门:添加链接描述)使用CMAKE进行编译,或者点击我的百度网盘链接:添加链接描述 密码:kl3v,下载vtk8.0。
(2)编译VTK库文件
将下载好的VTK-8.0解压到3rdParty\下,在VTK-8.0里新建build文件夹,并清空PCL自带的VTK文件夹的内容,使用CMAKE进行相应的设置。
where is the source code 为你的VTK-8.0的路径
where to build the binaries 为VTK-8.0里build的路径
如图所示,第一次点击configure,等configure完成之后勾选Grouped和Advanced,进行以下设置:
BUILD下取消勾选BUILD_TESTING
CMAKE下CMAKE_INSTALL_PREFIX设置为你清空的VTK文件夹
VTK下勾选VTK_Group_Qt,VTK_RENDERING_BACKEND设置为OpenGL(这里一定要注意,否则pcl显示框会出错)
点击Add Entry,添加CMAKE_DEBUG_POSTFIX,Value设置为-gd(用来区别debug和release版本)
再次点击configure,如无error,点击Genrate。
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第18张图片
进入到build目录下,使用VS打开VTK.sln
首先Debug x64下,右键ALL_BUILD生成,再右键INSTALL生成;
然后Release x64下,右键ALL_BUILD生成,再右键INSTALL生成;
将3rdParty\VTK\plugins\designer下的QVTKWidgetPlugin.dll拷贝到QT\5.7\msvc2015_64\plugins\designer下,这样Qt里面就有了QVtk的控件了。
然后不要忘了将上面的PCL VTK库文件目录改成自己命名或者生成的库文件夹名字,Debug和release都需要
PCL1.8.1+VTK8.0.0+QT5.9+VS2017在Win10环境下的配置_第19张图片
至此PCL在windows下的环境已经搭配好了,可以选择重启让环境变量生效。
至此,大功告成。这个编译过程可以参考文章添加链接描述

你可能感兴趣的:(程序人生)