• 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两个包。如下图所示

    我这里下载的是1.8.1版本

    ②百度网盘连接如下:

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

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

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

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

    安装:

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

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

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

    正常情况下应该是:

    如果文件夹下只有一个:

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

    全部安装完成后,将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目录下的所有文件复制

    粘贴到D:\PCL 1.8.1\bin

     至此,PCL安装完成!

    (2)系统环境配置

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

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

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

    双击Path(此处系统环境变量与用户环境变量区别在于系统环境变量可对所有用户起作用,用户环境变量只能对当前用户起作用,为方便起见,我们选择系统变量)。

    添加:

    1. %PCL_ROOT%\bin
    2. %PCL_ROOT%\3rdParty\VTK\bin
    3. %PCL_ROOT%\3rdParty\FLANN\bin
    4. %OPENNI2_REDIST64%
    5. %PCL_ROOT%\3rdParty\Qhull\bin
    6. %PCL_ROOT%\3rdParty\OpenNI2\Tools

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

    (3)Visual Studio开发环境配置

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

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

    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

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

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

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

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

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

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

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

    5.VC++目录->预处理器->预处理器定义设置
    1. BOOST_USE_WINDOWS_H
    2. NOMINMAX
    3. _CRT_SECURE_NO_DEPRECATE
    4. _SCL_SECURE_NO_WARNINGS
    5. _CRT_SECURE_NO_WARNINGS
    6. _SILENCE_FPOS_SEEKPOS_DEPRECATION_WARNING
    6.链接器->输入->附加依赖项设置(将下列库文件复制粘贴进去)(重点)

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

    1. pcl_common_debug.lib
    2. pcl_features_debug.lib
    3. pcl_filters_debug.lib
    4. pcl_io_debug.lib
    5. pcl_io_ply_debug.lib
    6. pcl_kdtree_debug.lib
    7. pcl_keypoints_debug.lib
    8. pcl_ml_debug.lib
    9. pcl_octree_debug.lib
    10. pcl_outofcore_debug.lib
    11. pcl_people_debug.lib
    12. pcl_recognition_debug.lib
    13. pcl_registration_debug.lib
    14. pcl_sample_consensus_debug.lib
    15. pcl_search_debug.lib
    16. pcl_segmentation_debug.lib
    17. pcl_stereo_debug.lib
    18. pcl_surface_debug.lib
    19. pcl_tracking_debug.lib
    20. pcl_visualization_debug.lib
    21. libboost_atomic-vc141-mt-gd-1_64.lib
    22. libboost_bzip2-vc141-mt-gd-1_64.lib
    23. libboost_chrono-vc141-mt-gd-1_64.lib
    24. libboost_container-vc141-mt-gd-1_64.lib
    25. libboost_context-vc141-mt-gd-1_64.lib
    26. libboost_coroutine-vc141-mt-gd-1_64.lib
    27. libboost_date_time-vc141-mt-gd-1_64.lib
    28. libboost_exception-vc141-mt-gd-1_64.lib
    29. libboost_fiber-vc141-mt-gd-1_64.lib
    30. libboost_filesystem-vc141-mt-gd-1_64.lib
    31. libboost_graph-vc141-mt-gd-1_64.lib
    32. libboost_graph_parallel-vc141-mt-gd-1_64.lib
    33. libboost_iostreams-vc141-mt-gd-1_64.lib
    34. libboost_locale-vc141-mt-gd-1_64.lib
    35. libboost_log-vc141-mt-gd-1_64.lib
    36. libboost_log_setup-vc141-mt-gd-1_64.lib
    37. libboost_math_c99-vc141-mt-gd-1_64.lib
    38. libboost_math_c99f-vc141-mt-gd-1_64.lib
    39. libboost_math_c99l-vc141-mt-gd-1_64.lib
    40. libboost_math_tr1-vc141-mt-gd-1_64.lib
    41. libboost_math_tr1f-vc141-mt-gd-1_64.lib
    42. libboost_math_tr1l-vc141-mt-gd-1_64.lib
    43. libboost_mpi-vc141-mt-gd-1_64.lib
    44. libboost_numpy-vc141-mt-gd-1_64.lib
    45. libboost_numpy3-vc141-mt-gd-1_64.lib
    46. libboost_prg_exec_monitor-vc141-mt-gd-1_64.lib
    47. libboost_program_options-vc141-mt-gd-1_64.lib
    48. libboost_python-vc141-mt-gd-1_64.lib
    49. libboost_python3-vc141-mt-gd-1_64.lib
    50. libboost_random-vc141-mt-gd-1_64.lib
    51. libboost_regex-vc141-mt-gd-1_64.lib
    52. libboost_serialization-vc141-mt-gd-1_64.lib
    53. libboost_signals-vc141-mt-gd-1_64.lib
    54. libboost_system-vc141-mt-gd-1_64.lib
    55. libboost_test_exec_monitor-vc141-mt-gd-1_64.lib
    56. libboost_thread-vc141-mt-gd-1_64.lib
    57. libboost_timer-vc141-mt-gd-1_64.lib
    58. libboost_type_erasure-vc141-mt-gd-1_64.lib
    59. libboost_unit_test_framework-vc141-mt-gd-1_64.lib
    60. libboost_wave-vc141-mt-gd-1_64.lib
    61. libboost_wserialization-vc141-mt-gd-1_64.lib
    62. libboost_zlib-vc141-mt-gd-1_64.lib
    63. vtkalglib-8.0-gd.lib
    64. vtkChartsCore-8.0-gd.lib
    65. vtkCommonColor-8.0-gd.lib
    66. vtkCommonComputationalGeometry-8.0-gd.lib
    67. vtkCommonCore-8.0-gd.lib
    68. vtkCommonDataModel-8.0-gd.lib
    69. vtkCommonExecutionModel-8.0-gd.lib
    70. vtkCommonMath-8.0-gd.lib
    71. vtkCommonMisc-8.0-gd.lib
    72. vtkCommonSystem-8.0-gd.lib
    73. vtkCommonTransforms-8.0-gd.lib
    74. vtkDICOMParser-8.0-gd.lib
    75. vtkDomainsChemistry-8.0-gd.lib
    76. vtkexoIIc-8.0-gd.lib
    77. vtkexpat-8.0-gd.lib
    78. vtkFiltersAMR-8.0-gd.lib
    79. vtkFiltersCore-8.0-gd.lib
    80. vtkFiltersExtraction-8.0-gd.lib
    81. vtkFiltersFlowPaths-8.0-gd.lib
    82. vtkFiltersGeneral-8.0-gd.lib
    83. vtkFiltersGeneric-8.0-gd.lib
    84. vtkFiltersGeometry-8.0-gd.lib
    85. vtkFiltersHybrid-8.0-gd.lib
    86. vtkFiltersHyperTree-8.0-gd.lib
    87. vtkFiltersImaging-8.0-gd.lib
    88. vtkFiltersModeling-8.0-gd.lib
    89. vtkFiltersParallel-8.0-gd.lib
    90. vtkFiltersParallelImaging-8.0-gd.lib
    91. vtkFiltersPoints-8.0-gd.lib
    92. vtkFiltersProgrammable-8.0-gd.lib
    93. vtkFiltersSelection-8.0-gd.lib
    94. vtkFiltersSMP-8.0-gd.lib
    95. vtkFiltersSources-8.0-gd.lib
    96. vtkFiltersStatistics-8.0-gd.lib
    97. vtkFiltersTexture-8.0-gd.lib
    98. vtkFiltersTopology-8.0-gd.lib
    99. vtkFiltersVerdict-8.0-gd.lib
    100. vtkfreetype-8.0-gd.lib
    101. vtkGeovisCore-8.0-gd.lib
    102. vtkgl2ps-8.0-gd.lib
    103. vtkhdf5-8.0-gd.lib
    104. vtkhdf5_hl-8.0-gd.lib
    105. vtkImagingColor-8.0-gd.lib
    106. vtkImagingCore-8.0-gd.lib
    107. vtkImagingFourier-8.0-gd.lib
    108. vtkImagingGeneral-8.0-gd.lib
    109. vtkImagingHybrid-8.0-gd.lib
    110. vtkImagingMath-8.0-gd.lib
    111. vtkImagingMorphological-8.0-gd.lib
    112. vtkImagingSources-8.0-gd.lib
    113. vtkImagingStatistics-8.0-gd.lib
    114. vtkImagingStencil-8.0-gd.lib
    115. vtkInfovisCore-8.0-gd.lib
    116. vtkInfovisLayout-8.0-gd.lib
    117. vtkInteractionImage-8.0-gd.lib
    118. vtkInteractionStyle-8.0-gd.lib
    119. vtkInteractionWidgets-8.0-gd.lib
    120. vtkIOAMR-8.0-gd.lib
    121. vtkIOCore-8.0-gd.lib
    122. vtkIOEnSight-8.0-gd.lib
    123. vtkIOExodus-8.0-gd.lib
    124. vtkIOExport-8.0-gd.lib
    125. vtkIOExportOpenGL-8.0-gd.lib
    126. vtkIOGeometry-8.0-gd.lib
    127. vtkIOImage-8.0-gd.lib
    128. vtkIOImport-8.0-gd.lib
    129. vtkIOInfovis-8.0-gd.lib
    130. vtkIOLegacy-8.0-gd.lib
    131. vtkIOLSDyna-8.0-gd.lib
    132. vtkIOMINC-8.0-gd.lib
    133. vtkIOMovie-8.0-gd.lib
    134. vtkIONetCDF-8.0-gd.lib
    135. vtkIOParallel-8.0-gd.lib
    136. vtkIOParallelXML-8.0-gd.lib
    137. vtkIOPLY-8.0-gd.lib
    138. vtkIOSQL-8.0-gd.lib
    139. vtkIOTecplotTable-8.0-gd.lib
    140. vtkIOVideo-8.0-gd.lib
    141. vtkIOXML-8.0-gd.lib
    142. vtkIOXMLParser-8.0-gd.lib
    143. vtkjpeg-8.0-gd.lib
    144. vtkjsoncpp-8.0-gd.lib
    145. vtklibharu-8.0-gd.lib
    146. vtklibxml2-8.0-gd.lib
    147. vtklz4-8.0-gd.lib
    148. vtkmetaio-8.0-gd.lib
    149. vtkNetCDF-8.0-gd.lib
    150. vtknetcdf_c++-gd.lib
    151. vtkoggtheora-8.0-gd.lib
    152. vtkParallelCore-8.0-gd.lib
    153. vtkpng-8.0-gd.lib
    154. vtkproj4-8.0-gd.lib
    155. vtkRenderingAnnotation-8.0-gd.lib
    156. vtkRenderingContext2D-8.0-gd.lib
    157. vtkRenderingContextOpenGL-8.0-gd.lib
    158. vtkRenderingCore-8.0-gd.lib
    159. vtkRenderingFreeType-8.0-gd.lib
    160. vtkRenderingGL2PS-8.0-gd.lib
    161. vtkRenderingImage-8.0-gd.lib
    162. vtkRenderingLabel-8.0-gd.lib
    163. vtkRenderingLIC-8.0-gd.lib
    164. vtkRenderingLOD-8.0-gd.lib
    165. vtkRenderingOpenGL-8.0-gd.lib
    166. vtkRenderingVolume-8.0-gd.lib
    167. vtkRenderingVolumeOpenGL-8.0-gd.lib
    168. vtksqlite-8.0-gd.lib
    169. vtksys-8.0-gd.lib
    170. vtktiff-8.0-gd.lib
    171. vtkverdict-8.0-gd.lib
    172. vtkViewsContext2D-8.0-gd.lib
    173. vtkViewsCore-8.0-gd.lib
    174. vtkViewsInfovis-8.0-gd.lib
    175. vtkzlib-8.0-gd.lib

     如果需要release版本的库目录如下:

    1. pcl_common_release.lib
    2. pcl_features_release.lib
    3. pcl_filters_release.lib
    4. pcl_io_ply_release.lib
    5. pcl_io_release.lib
    6. pcl_kdtree_release.lib
    7. pcl_keypoints_release.lib
    8. pcl_ml_release.lib
    9. pcl_octree_release.lib
    10. pcl_outofcore_release.lib
    11. pcl_people_release.lib
    12. pcl_recognition_release.lib
    13. pcl_registration_release.lib
    14. pcl_sample_consensus_release.lib
    15. pcl_search_release.lib
    16. pcl_segmentation_release.lib
    17. pcl_stereo_release.lib
    18. pcl_surface_release.lib
    19. pcl_tracking_release.lib
    20. pcl_visualization_release.lib
    21. libboost_atomic-vc141-mt-1_64.lib
    22. libboost_bzip2-vc141-mt-1_64.lib
    23. libboost_chrono-vc141-mt-1_64.lib
    24. libboost_container-vc141-mt-1_64.lib
    25. libboost_context-vc141-mt-1_64.lib
    26. libboost_coroutine-vc141-mt-1_64.lib
    27. libboost_date_time-vc141-mt-1_64.lib
    28. libboost_exception-vc141-mt-1_64.lib
    29. libboost_fiber-vc141-mt-1_64.lib
    30. libboost_filesystem-vc141-mt-1_64.lib
    31. libboost_graph-vc141-mt-1_64.lib
    32. libboost_graph_parallel-vc141-mt-1_64.lib
    33. libboost_iostreams-vc141-mt-1_64.lib
    34. libboost_locale-vc141-mt-1_64.lib
    35. libboost_log-vc141-mt-1_64.lib
    36. libboost_log_setup-vc141-mt-1_64.lib
    37. libboost_math_c99-vc141-mt-1_64.lib
    38. libboost_math_c99f-vc141-mt-1_64.lib
    39. libboost_math_c99l-vc141-mt-1_64.lib
    40. libboost_math_tr1-vc141-mt-1_64.lib
    41. libboost_math_tr1f-vc141-mt-1_64.lib
    42. libboost_math_tr1l-vc141-mt-1_64.lib
    43. libboost_mpi-vc141-mt-1_64.lib
    44. libboost_numpy-vc141-mt-1_64.lib
    45. libboost_numpy3-vc141-mt-1_64.lib
    46. libboost_prg_exec_monitor-vc141-mt-1_64.lib
    47. libboost_program_options-vc141-mt-1_64.lib
    48. libboost_python-vc141-mt-1_64.lib
    49. libboost_python3-vc141-mt-1_64.lib
    50. libboost_random-vc141-mt-1_64.lib
    51. libboost_regex-vc141-mt-1_64.lib
    52. libboost_serialization-vc141-mt-1_64.lib
    53. libboost_signals-vc141-mt-1_64.lib
    54. libboost_system-vc141-mt-1_64.lib
    55. libboost_test_exec_monitor-vc141-mt-1_64.lib
    56. libboost_thread-vc141-mt-1_64.lib
    57. libboost_timer-vc141-mt-1_64.lib
    58. libboost_type_erasure-vc141-mt-1_64.lib
    59. libboost_unit_test_framework-vc141-mt-1_64.lib
    60. libboost_wave-vc141-mt-1_64.lib
    61. libboost_wserialization-vc141-mt-1_64.lib
    62. libboost_zlib-vc141-mt-1_64.lib
    63. vtkalglib-8.0.lib
    64. vtkChartsCore-8.0.lib
    65. vtkCommonColor-8.0.lib
    66. vtkCommonComputationalGeometry-8.0.lib
    67. vtkCommonCore-8.0.lib
    68. vtkCommonDataModel-8.0.lib
    69. vtkCommonExecutionModel-8.0.lib
    70. vtkCommonMath-8.0.lib
    71. vtkCommonMisc-8.0.lib
    72. vtkCommonSystem-8.0.lib
    73. vtkCommonTransforms-8.0.lib
    74. vtkDICOMParser-8.0.lib
    75. vtkDomainsChemistry-8.0.lib
    76. vtkexoIIc-8.0.lib
    77. vtkexpat-8.0.lib
    78. vtkFiltersAMR-8.0.lib
    79. vtkFiltersCore-8.0.lib
    80. vtkFiltersExtraction-8.0.lib
    81. vtkFiltersFlowPaths-8.0.lib
    82. vtkFiltersGeneral-8.0.lib
    83. vtkFiltersGeneric-8.0.lib
    84. vtkFiltersGeometry-8.0.lib
    85. vtkFiltersHybrid-8.0.lib
    86. vtkFiltersHyperTree-8.0.lib
    87. vtkFiltersImaging-8.0.lib
    88. vtkFiltersModeling-8.0.lib
    89. vtkFiltersParallel-8.0.lib
    90. vtkFiltersParallelImaging-8.0.lib
    91. vtkFiltersPoints-8.0.lib
    92. vtkFiltersProgrammable-8.0.lib
    93. vtkFiltersSelection-8.0.lib
    94. vtkFiltersSMP-8.0.lib
    95. vtkFiltersSources-8.0.lib
    96. vtkFiltersStatistics-8.0.lib
    97. vtkFiltersTexture-8.0.lib
    98. vtkFiltersTopology-8.0.lib
    99. vtkFiltersVerdict-8.0.lib
    100. vtkfreetype-8.0.lib
    101. vtkGeovisCore-8.0.lib
    102. vtkgl2ps-8.0.lib
    103. vtkhdf5-8.0.lib
    104. vtkhdf5_hl-8.0.lib
    105. vtkImagingColor-8.0.lib
    106. vtkImagingCore-8.0.lib
    107. vtkImagingFourier-8.0.lib
    108. vtkImagingGeneral-8.0.lib
    109. vtkImagingHybrid-8.0.lib
    110. vtkImagingMath-8.0.lib
    111. vtkImagingMorphological-8.0.lib
    112. vtkImagingSources-8.0.lib
    113. vtkImagingStatistics-8.0.lib
    114. vtkImagingStencil-8.0.lib
    115. vtkInfovisCore-8.0.lib
    116. vtkInfovisLayout-8.0.lib
    117. vtkInteractionImage-8.0.lib
    118. vtkInteractionStyle-8.0.lib
    119. vtkInteractionWidgets-8.0.lib
    120. vtkIOAMR-8.0.lib
    121. vtkIOCore-8.0.lib
    122. vtkIOEnSight-8.0.lib
    123. vtkIOExodus-8.0.lib
    124. vtkIOExport-8.0.lib
    125. vtkIOExportOpenGL-8.0.lib
    126. vtkIOGeometry-8.0.lib
    127. vtkIOImage-8.0.lib
    128. vtkIOImport-8.0.lib
    129. vtkIOInfovis-8.0.lib
    130. vtkIOLegacy-8.0.lib
    131. vtkIOLSDyna-8.0.lib
    132. vtkIOMINC-8.0.lib
    133. vtkIOMovie-8.0.lib
    134. vtkIONetCDF-8.0.lib
    135. vtkIOParallel-8.0.lib
    136. vtkIOParallelXML-8.0.lib
    137. vtkIOPLY-8.0.lib
    138. vtkIOSQL-8.0.lib
    139. vtkIOTecplotTable-8.0.lib
    140. vtkIOVideo-8.0.lib
    141. vtkIOXML-8.0.lib
    142. vtkIOXMLParser-8.0.lib
    143. vtkjpeg-8.0.lib
    144. vtkjsoncpp-8.0.lib
    145. vtklibharu-8.0.lib
    146. vtklibxml2-8.0.lib
    147. vtklz4-8.0.lib
    148. vtkmetaio-8.0.lib
    149. vtkNetCDF-8.0.lib
    150. vtkoggtheora-8.0.lib
    151. vtkParallelCore-8.0.lib
    152. vtkpng-8.0.lib
    153. vtkproj4-8.0.lib
    154. vtkRenderingAnnotation-8.0.lib
    155. vtkRenderingContext2D-8.0.lib
    156. vtkRenderingContextOpenGL-8.0.lib
    157. vtkRenderingCore-8.0.lib
    158. vtkRenderingFreeType-8.0.lib
    159. vtkRenderingGL2PS-8.0.lib
    160. vtkRenderingImage-8.0.lib
    161. vtkRenderingLabel-8.0.lib
    162. vtkRenderingLIC-8.0.lib
    163. vtkRenderingLOD-8.0.lib
    164. vtkRenderingOpenGL-8.0.lib
    165. vtkRenderingVolume-8.0.lib
    166. vtkRenderingVolumeOpenGL-8.0.lib
    167. vtksqlite-8.0.lib
    168. vtksys-8.0.lib
    169. vtktiff-8.0.lib
    170. vtkverdict-8.0.lib
    171. vtkViewsContext2D-8.0.lib
    172. vtkViewsCore-8.0.lib
    173. vtkViewsInfovis-8.0.lib
    174. vtkzlib-8.0.lib
    175. flann-gd.lib
    176. flann.lib
    177. flann_cpp-gd.lib
    178. flann_cpp.lib
    179. flann_cpp_s-gd.lib
    180. flann_cpp_s.lib
    181. flann_s-gd.lib
    182. flann_s.lib
    183. qhull.lib
    184. qhullcpp.lib
    185. qhullcpp_d.lib
    186. qhullstatic.lib
    187. qhullstatic_d.lib
    188. qhullstatic_r.lib
    189. qhullstatic_r_d.lib
    190. qhull_d.lib
    191. qhull_p.lib
    192. qhull_p_d.lib
    193. qhull_r.lib
    194. qhull_r_d.lib
    195. OpenNI2.lib

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

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

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

    库文件: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

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

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

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

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


    ④在文件下可看见一个文档,打开就可复制链接库列表

    同理可得到release版本

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

    8.保存PCL1.8.1属性表。

    则此时

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

    四、环境测试

     斯坦福兔子测试程序:

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

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

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

    具体代码:

    1. #include
    2. #include
    3. #include
    4. #include
    5. #include
    6. int user_data;
    7. using std::cout;
    8. void viewerOneOff(pcl::visualization::PCLVisualizer& viewer) {
    9. viewer.setBackgroundColor(1.0, 0.5, 1.0); //设置背景颜色
    10. }
    11. int main() {
    12. pcl::PointCloud::Ptr cloud(new pcl::PointCloud);
    13. char strfilepath[256] = "rabbit.pcd";
    14. if (-1 == pcl::io::loadPCDFile(strfilepath, *cloud)) {
    15. cout << "error input!" << endl;
    16. return -1;
    17. }
    18. cout << cloud->points.size() << endl;
    19. pcl::visualization::CloudViewer viewer("Cloud Viewer"); //创建viewer对象
    20. viewer.showCloud(cloud);
    21. viewer.runOnVisualizationThreadOnce(viewerOneOff);
    22. system("pause");
    23. return 0;
    24. }

    缩小屏幕得到:

    环境成功!!!!

  • 相关阅读:
    Redis集群(Cluster)
    零信任的三种主流技术【远航】
    nodejs+vue+elementui学生宿舍公寓报修管理系统python+php
    Windows用户如何将cpolar内网穿透配置成后台服务,并开机自启动?
    解决Java中https请求接口报错问题
    prim算法求解最小生成树 C++实现
    果蝇(FOA)优化算法(附完整Matlab代码,可直接复制)
    LeetCode78.子集
    基于安卓Android银行排队叫号系统设计与实现
    Android---打开相机拍照
  • 原文地址:https://blog.csdn.net/qq_56294106/article/details/134558444