Windows + VS2022超详细点云库(PCL1.8.1)配置

本文在结合多位CSDN大佬的步骤,记录以下最全的点云配置过程,防止走弯路(并在最后配上PCL环境配置成功的测试代码-彩色兔子)

一、PCL介绍

PCL概述_pcl技术_一杯盐水的博客-CSDN博客

二、准备工作(PCL版本的下载)

这里介绍的是在写这篇博客过程时候,官方对于PCL版本最新的更新状态为1.13.0,但是笔者还是采用了之前下载好的PCL1.8.1版本

①官方下载网站: Releases · PointCloudLibrary/pcl · GitHubReleases · PointCloudLibrary/pcl (github.com)Releases · PointCloudLibrary/pcl · GitHub 下载点云库的安装包,我们需要的是AllInOne和pdb两个包。如下图所示

Windows + VS2022超详细点云库(PCL1.8.1)配置_第1张图片

我这里下载的是1.8.1版本

Windows + VS2022超详细点云库(PCL1.8.1)配置_第2张图片

②百度网盘连接如下:

三、对于PCL1.8.1版本在vs2022上面的配置(其他版本同理,但需要注意配置环境中的细节问题,下文在具体步骤会提醒)

(1)在下载好的文件中点击.exe文件,安装PCL

Windows + VS2022超详细点云库(PCL1.8.1)配置_第3张图片

运行中:无脑点击下一步,但其中关键步骤点击如下

Windows + VS2022超详细点云库(PCL1.8.1)配置_第4张图片

安装路径选择D盘,系统会自动生成PCL 1.8.1文件,点击下一步。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第5张图片

安装:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第6张图片

接下来点击安装便可以开始漫长的安装过程。

一段时间之后,会弹出来一个OpenNI2的安装窗口,此时直接一路下一步就好。

等待安装结束后,检查D:\PCL 1.8.1\3rdParty(这里是刚才选择安装路径时候我直接选择的是D盘)目录下的文件夹下的OpenNI2

Windows + VS2022超详细点云库(PCL1.8.1)配置_第7张图片

正常情况下应该是:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第8张图片

如果文件夹下只有一个:

则需要双击该OpenNI-Windows-x64-2.2.msi文件:我们点击Remove移除C盘下的文件到D:\PCL 1.8.1\3rdParty\OpenNI2。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第9张图片

Windows + VS2022超详细点云库(PCL1.8.1)配置_第10张图片

Windows + VS2022超详细点云库(PCL1.8.1)配置_第11张图片

全部安装完成后,将pcl-1.11.1-pdb-msvc2019-win64.zip解压后的.pdb文件拷贝到D:\PCL 1.8.1\bin目录下:

将该D:\pcl-1.8.1-pdb-msvc2017-win64\pcl-1.8.1-pdb-msvc2017-win64目录下的所有文件复制

Windows + VS2022超详细点云库(PCL1.8.1)配置_第12张图片

粘贴到D:\PCL 1.8.1\bin

Windows + VS2022超详细点云库(PCL1.8.1)配置_第13张图片

 至此,PCL安装完成!

(2)系统环境配置

a、每次使用都需要进行的设置

1.点开电脑开关按钮-设置-系统设置-关于-高级系统设置-高级—环境变量—系统变量

Windows + VS2022超详细点云库(PCL1.8.1)配置_第14张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第15张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第16张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第17张图片

此时,我们可以看到PCL的根目录以及OpenNI2的目录已经添加到了系统变量中。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第18张图片

双击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

Windows + VS2022超详细点云库(PCL1.8.1)配置_第19张图片

设置完成后重启电脑,使环境变量生效

(3)Visual Studio开发环境配置

1.首先打开Visual Studio,然后新建一个C++工程,再新建一个cpp文件。同时,将解决方案配置设为Debug,解决方案平台设为x64。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第20张图片

2.右键新建的项目-点击属性,打开属性页

Windows + VS2022超详细点云库(PCL1.8.1)配置_第21张图片

3.选择调试,在环境一栏中粘贴以下内容:(注意具体PCL版本不一样需要进行相应修改)

PATH=D:\PCL 1.8.1\\bin;D:\PCL 1.8.1\\3rdParty\FLANN\bin;D:\PCL 1.8.1\\3rdParty\VTK\bin;D:\PCL 1.8.1\\3rdParty\OpenNI2\Tools

PATH=D:\PCL 1.8.1\\bin;D:\PCL 1.8.1\\3rdParty\FLANN\bin;D:\PCL 1.8.1\\3rdParty\VTK\bin;D:\PCL 1.8.1\\3rdParty\OpenNI2\Tools

Windows + VS2022超详细点云库(PCL1.8.1)配置_第22张图片

4.c/c++->常规->SDL检查设置选择“否”:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第23张图片

5.c/c++->语言->SDL检查设置选择“否”:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第24张图片

b、使用添加属性表的形式,只需配置一次,今后可引用之前的.props包

1.打开视图-其他窗口-属性管理器

Windows + VS2022超详细点云库(PCL1.8.1)配置_第25张图片

2.打开属性管理器,右键Debug|x64,点击添加新项目属性表,添加一个新属性表

Windows + VS2022超详细点云库(PCL1.8.1)配置_第26张图片

3. 新建一个PLC1.8.1.props属性表
4.双击新添加的PCL1.11.1.props,在其VC++目录->包含目录下逐项添加7个include路径:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第27张图片

Windows + VS2022超详细点云库(PCL1.8.1)配置_第28张图片

4.VC++目录->包含目录下逐项添加6个lib路径

Windows + VS2022超详细点云库(PCL1.8.1)配置_第29张图片

5.VC++目录->预处理器->预处理器定义设置
BOOST_USE_WINDOWS_H
NOMINMAX
_CRT_SECURE_NO_DEPRECATE
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS
_SILENCE_FPOS_SEEKPOS_DEPRECATION_WARNING
Windows + VS2022超详细点云库(PCL1.8.1)配置_第30张图片6.链接器->输入->附加依赖项设置(将下列库文件复制粘贴进去)(重点)

本人配置的是Debug模式,所以所有的debug库目录如下:(注意release版本的库目录需要分开配置,并且版本不一样所得到的库目录不一样,在下面会介绍如何得出自己的库目录并将Debug与release版本单独分开保存)(库文件非常多,自己一个一个手动更换版本号非常麻烦,如何得到自己的库文件在第7.点会介绍)

Windows + VS2022超详细点云库(PCL1.8.1)配置_第31张图片

pcl_common_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_debug.lib
pcl_io_ply_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_numpy-vc141-mt-gd-1_64.lib
libboost_numpy3-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_python-vc141-mt-gd-1_64.lib
libboost_python3-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
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
vtknetcdf_c++-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

 如果需要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
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
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
flann-gd.lib
flann.lib
flann_cpp-gd.lib
flann_cpp.lib
flann_cpp_s-gd.lib
flann_cpp_s.lib
flann_s-gd.lib
flann_s.lib
qhull.lib
qhullcpp.lib
qhullcpp_d.lib
qhullstatic.lib
qhullstatic_d.lib
qhullstatic_r.lib
qhullstatic_r_d.lib
qhull_d.lib
qhull_p.lib
qhull_p_d.lib
qhull_r.lib
qhull_r_d.lib
OpenNI2.lib

如果你是和我的版本一样,那么恭喜你不用操心,版本不同库文件不同的问题,那么到此,就全部结束了!只需要测试一下自己的环境是否配置成功即可,如果你不是1.8.1版本则需要自己手动得到属于自己的库文件,并且该库文件区分debug和release两个版本,需要自己分开(官方给的库文件是混合在一起的)

7.配置自己的库文件,并快捷的方式区分debug和release版本

主要的库文件在:两个主要的地方

Windows + VS2022超详细点云库(PCL1.8.1)配置_第32张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第33张图片

库文件:pcl debug版、 boost debug版、vtk debug版, flann qhull  NI2  debug版

pcl release 版、vtk release版本、 boost release版本、flann qhull NI2  release 版


①win+r调出“运行”窗口并输出cmd
②输入:cd /d D:\P_pcl\PCL1.9.0\PCL 1.9.0\3rdParty\VTK\lib 回车 (填自己的路径)
③输出:获取PCL 1.8.1\lib中的debug.lib文件dir /b *debug.lib>1.txt

Windows + VS2022超详细点云库(PCL1.8.1)配置_第34张图片

(若是获取PCL 1.8.1\3rdParty\VTK\lib中的debug.lib文件,则改为dir /b *gd.lib>1.txt

Windows + VS2022超详细点云库(PCL1.8.1)配置_第35张图片

(若是获取D:\PCL 1.8.1\3rdParty\Qhull\lib中的debug.lib文件,则改为dir /b *d-1_64.lib>1.txt

Windows + VS2022超详细点云库(PCL1.8.1)配置_第36张图片

(若是获取D:\PCL 1.8.1\3rdParty\FLANN\lib中的debug.lib文件,则改为dir /b *gd.lib>1.txt)

Windows + VS2022超详细点云库(PCL1.8.1)配置_第37张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第38张图片

(若是获取D:\PCL 1.8.1\3rdParty\Qhull\lib中的debug.lib文件,则改为dir /b *d.lib>1.txt)

Windows + VS2022超详细点云库(PCL1.8.1)配置_第39张图片Windows + VS2022超详细点云库(PCL1.8.1)配置_第40张图片
④在文件下可看见一个文档,打开就可复制链接库列表

同理可得到release版本

此时,我们将所有的1.txt文件汇总,即可以得到我们完整的debug库

8.保存PCL1.8.1属性表。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第41张图片

则此时

在我们所创建的项目文件目录下会出现:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第42张图片

四、环境测试

 斯坦福兔子测试程序:

首先,下载斯坦福兔子.pcd文件。

百度网盘:链接:百度网盘 请输入提取码百度网盘为您提供文件的网络备份、同步和分享服务。空间大、速度快、安全稳固,支持教育网加速,支持手机端。注册使用百度网盘即可享受免费存储空间icon-default.png?t=N7T8https://pan.baidu.com/s/1Tkb0vVVgq52X808NDaGpzw  
                  提取码:0122 

下载完成后,将rabbit.pcd文件移动到项目文件下。

Windows + VS2022超详细点云库(PCL1.8.1)配置_第43张图片

具体代码:

#include
#include
#include
#include
#include
int user_data;
using std::cout;
 
 
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer) {
	viewer.setBackgroundColor(1.0, 0.5, 1.0);   //设置背景颜色
}
 
int main() {
	pcl::PointCloud::Ptr cloud(new pcl::PointCloud);
 
	char strfilepath[256] = "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;
}

缩小屏幕得到:

Windows + VS2022超详细点云库(PCL1.8.1)配置_第44张图片

环境成功!!!!

你可能感兴趣的:(windows)