当前位置: 代码迷 >> 综合 >> Win7+VS2017+PCL1.8.1环境配置
  详细解决方案

Win7+VS2017+PCL1.8.1环境配置

热度:22   发布时间:2024-02-12 02:26:10.0

PCL库安装与VS2017环境变量配置

一、PCL安装
(1)下载对应版本PCL文件
首先进入PCL官网找到资源下载,官网地址如下:http://pointclouds.org。
在这里插入图片描述

进入官网主页后点击主页上的Downloads,进入Downloads页面后点击Releases ,接着点击tags,然后可以看到不同版本的PCL,
在这里插入图片描述

找到自己想要的版本点进去(我选的是PCL1.8.1版本),点进去后将页面拉到最下面就可以看到跟电脑操作系统以及VS版本对应的下载资源,需下载两个文件(如我的电脑是64位操作系统、VS是2017版本,则需要下载PCL-1.8.1-AllInOne-msvc2017-win64.exe和pcl-1.8.1-pdb-msvc2017-win64.zip两个文件)。
在这里插入图片描述

(2)运行安装文件
点击PCL-1.8.1-AllInOne-msvc2017-win64.exe开始安装。安装过程中特别需要说明的地方会截图出来,未做截图说明的,默认即可。
在下图中一定勾选上Add PCL to system PATH for all users。
在这里插入图片描述

安装路径默认是C盘,可自行修改路径。
在这里插入图片描述

安装路径修改好后开始安装,安装途中会弹出OpenNI的安装程序,将安装路径改为你安装的PCL路径下的3rdParty文件夹下的OpenNI2文件夹中,然后点击下一步等待安装。
解压pcl-1.8.1-pdb-msvc2017-win64.zip文件,复制里面的所有内容到你PCL安装路径下的bin文件夹(记住不要把整个文件夹直接复制过去,要复制里面的内容)。
OpenNI2安装结束之后就完成了点云库的完整安装,安装目录下的样子和3rdparty文件夹下的样子如下图:
在这里插入图片描述
在这里插入图片描述

所有的第三方库全部安装到了3rdparty文件夹中。
二、电脑环境变量配置
我的电脑右键–>属性–>高级系统设置–>环境变量。
在这里插入图片描述

这时候你可以在系统变量表中看到PCL的根目录和OPENNI2的目录,接下来找到系统变量路径path,编辑变量值加入以下路径:
%PCL_ROOT%\bin
%PCL_ROOT%\3rdParty\VTK\bin
%PCL_ROOT%\3rdParty\FLANN\bin
%PCL_ROOT%\3rdParty\Qhull\bin
%PCL_ROOT%\3rdParty\OpenNI2\Tools
%OPENNI2_REDIST64%
在这里插入图片描述

路径添加之后,重启电脑来应用环境变量。
三、VS开发环境配置
Visual Studio提供了两种编译模式:Debug和Release。Debug模式下,生成的应用程序中会插入许多的调试指令,因此调试起来及其方便,但是大幅度降低了程序的运行速度;Release模式便会提高程序的速度,但是调试相对较困难一些。
首先来讲Debug模式下的环境配置。
(1)打开VS新建一个控制台应用工程,工程名称和存放位置可自行修改(我工程名称为PCL),然后根据你下载的PCL版本来选择工程类型(我的是64位选的X64,32位的选择X86)。
在这里插入图片描述

(2)点击视图–>其他窗口–>属性管理器,展开你所建的工程名可以看到Debug|Win32,Debug|x64,Release|Win32,Release|x64四项,鼠标右键与你工程类型对应的一项,选择添加新项目属性表,名称和位置自己定(我命名为PCLDebug64,方便以后重复的使用,重复使用时选择添加现有属性表),
在这里插入图片描述

添加完成后展开并找到你所添加的属性表双击打开开始配置。
在这里插入图片描述

(3)打开属性页后,选择VC++目录,然后点击包含目录右侧的下拉菜单选择编辑,将以下目录填入窗口中:
D:\PCL\PCL 1.8.1\3rdParty\OpenNI2\Include
D:\PCL\PCL 1.8.1\include\pcl-1.8
D:\PCL\PCL 1.8.1\3rdParty\VTK\include\vtk-8.0
D:\PCL\PCL 1.8.1\3rdParty\QHull\include
D:\PCL\PCL 1.8.1\3rdParty\Eigen\eigen3
D:\PCL\PCL 1.8.1\3rdParty\FLANN\include
D:\PCL\PCL 1.8.1\3rdParty\Boost\include
\boost-1_64
在这里插入图片描述

注意:这里的D:\PCL\PCL 1.8.1是我安装点云库的路径,要根据自己的安装路径进行修改,同时上面标红的版本字体,需要打开相关目录进行检查。在目录填入完毕后点击确定。
(4)在VC++目录下点击库目录右侧下拉菜单选择编辑,将以下目录填入窗口中:
D:\PCL\PCL 1.8.1\3rdParty\OpenNI2\Lib
D:\PCL\PCL 1.8.1\3rdParty\VTK\lib
D:\PCL\PCL 1.8.1\3rdParty\Qhull\lib
D:\PCL\PCL 1.8.1\3rdParty\FLANN\lib
D:\PCL\PCL 1.8.1\3rdParty\Boost\lib
D:\PCL\PCL 1.8.1\lib
在这里插入图片描述

同样注意将D:\PCL\PCL 1.8.1更改为自己的点云库安装路径,然后点击确定。
(5)点击属性页中的C/C++下的预处理器,点击预处理器定义右侧下拉菜单选择编辑,将下面两条定义填入窗口,然后点击确定。
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS
在这里插入图片描述

(6)点击属性页中的链接器下的输入,点击附加依赖项右侧下拉菜单选择编辑,添加以下文件名:
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;
在这里插入图片描述

注意:这些文件名涉及到版本问题,需要去对应的lib文件进行核对,如libboost_atomic-vc141-mt-gd-1_64.lib可在D:\PCL\PCL 1.8.1\3rdParty\Boost\lib中找到。
在这里插入图片描述

也可以自己从lib文件中提取静态链接库文件名,下面提供一种便捷的方法:
例:提取D:\PCL\PCL 1.8.1\3rdParty\VTK\lib下的所有静态链接库文件名并存储至文本0.txt,方法如下:
1、win+r
2、输入:cmd回车
3、输入:cd /d D:\PCL 1.8.1\3rdParty\VTK\lib 回车
4、输入:dir /b *.lib *>0.txt 回车
在这里插入图片描述

(7)鼠标右键工程名称点击属性打开属性页,点击调试,然后点击环境右侧下拉菜单选择编辑,加入以下内容:
PATH= ( P C L R O O T ) b i n ; (PCL_ROOT)bin; (PCL_ROOT)3rdPartyFLANNbin; ( P C L R O O T ) 3 r d P a r t y V T K b i n ; (PCL_ROOT)3rdPartyVTKbin; (PCL_ROOT)Qhullbin; ( P C L R O O T ) 3 r d P a r t y O p e n N I 2 T o o l s ; (PCL_ROOT)3rdPartyOpenNI2Tools; (PATH)
在这里插入图片描述

这步完成后,Debug模式下的点云开发环境配置完成。Release模式和Debug配置步骤基本一样,区别在于第6步附加依赖项不一样,Release附加依赖项内容如下:
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;
pcl_io_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_numpy-vc141-mt-1_64.lib;
libboost_numpy3-vc141-mt-1_64.lib;
libboost_prg_exec_monitor-vc141-mt-1_64.lib;
libboost_program_options-vc141-mt-1_64.lib;
libboost_python-vc141-mt-1_64.lib;
libboost_python3-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;
OpenNI2.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;
vtknetcdf_c++.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;
qhull_p.lib;
qhull_r.lib;
qhull.lib;
qhullcpp.lib;
qhullstatic.lib;
qhullstatic_r.lib;
flann.lib;
flann_cpp.lib;
flann_cpp_s.lib;
flann_s.lib;
四、测试:显示小白兔
测试代码如下:
#include<pcl/visualization/cloud_viewer.h>
#include//标准C++库中的输入输出类相关头文件。
#include<pcl/io/io.h>
#include<pcl/io/pcd_io.h>//pcd 读写类相关的头文件。
#include<pcl/io/ply_io.h>
#include<pcl/point_types.h> //PCL中支持的点类型头文件。
int user_data;
using std::cout;

void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0); //设置背景颜色
}

int main() {
pcl::PointCloudpcl::PointXYZ::Ptr cloud(new pcl::PointCloudpcl::PointXYZ);

  char strfilepath[256] = "D:\\PCL\\rabbit.pcd";if (-1 == pcl::io::loadPCDFile(strfilepath, *cloud)) {cout << "error input!" << endl;return -1;}cout << cloud->points.size() << endl;pcl::visualization::CloudViewer viewer("Cloud Viewer");     //创建viewer对象viewer.showCloud(cloud);viewer.runOnVisualizationThreadOnce(viewerOneOff);system("pause");return 0;

}
rabbit.pcd在百度云盘https://pan.baidu.com/s/1Gsnsb4AllcJxjdsYbGw-Cw。
将程序中的路径D:\PCL\rabbit.pcd改为自己的,成功编译运行则配置成功。
在这里插入图片描述

  相关解决方案