搞了一上午终于搞定了,看了那么多的博文,参差不齐,都不知道相信哪个,配置成功后才知道其实和配置opencv是完全一样的,不像有的博主说的那样,一定要安装在C盘,我猜他们那样说是因为官方给的PCL.props里面是默认在C盘的。其实只要你不用官方的PCL.props文件来配置,就不需要安装在C盘,下面分享一下我的配置过程
1、下载文件(不是看你的系统是多少位的,主要看的是你建立的工程是多少位的)
我把安装过程中所用的所有文件都放在下面的链接里面,这是配置的先决条件(其中openNI是非必须的,但是为了以后方便使用,一起下载下来吧)
链接:
链接:http://pan.baidu.com/s/1gdqCNuj 密码:7aif
2、点开PCL-1.7.2-AllInOne-msvc2013-win32.exe 文件进行安装
3、配置环境变量
安装完成后,打开你的安装路径,打开PCL 1.7.2文件夹
复制上面的路径
回到桌面,右击计算机->属性->高级系统设置
以我的安装路径为例:在Path的变量值后面加上以下内容(就是安装路径下的bin文件夹)注意:用分号隔开
;E:\PCL_1.7.2\PCL1.7.2\bin;E:\PCL_1.7.2\PCL1.7.2\3rdParty\FLANN\bin;E:\PCL_1.7.2\PCL1.7.2\3rdParty\Qhull\bin;
E:\PCL_1.7.2\PCL 1.7.2\3rdParty\VTK\bin
4、打开VS2013进行配置
建立一个空白的C++项目(win32控制台程序)
将上面下载的文件(要用我的文件,官方的路径是放在C盘的,我把路径改到了该工程的工作目录下):example.cpp和example.pcd放在该工程的工作目录下
会发现一大堆的错误,不要着急,现在开始消除错误:
如果你的VS没有上图的属性管理器,可以在下图中找到
然后在右侧就会看到有属性管理器的窗口,然后:
将以下的.lib输入到上图的框中
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_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_surface_debug.lib
pcl_tracking_debug.lib
pcl_visualization_debug.lib
libboost_atomic-vc120-mt-gd-1_57.lib
libboost_chrono-vc120-mt-gd-1_57.lib
libboost_container-vc120-mt-gd-1_57.lib
libboost_context-vc120-mt-gd-1_57.lib
libboost_coroutine-vc120-mt-gd-1_57.lib
libboost_date_time-vc120-mt-gd-1_57.lib
libboost_exception-vc120-mt-gd-1_57.lib
libboost_filesystem-vc120-mt-gd-1_57.lib
libboost_graph-vc120-mt-gd-1_57.lib
libboost_iostreams-vc120-mt-gd-1_57.lib
libboost_locale-vc120-mt-gd-1_57.lib
libboost_log-vc120-mt-gd-1_57.lib
libboost_log_setup-vc120-mt-gd-1_57.lib
libboost_math_c99-vc120-mt-gd-1_57.lib
libboost_math_c99f-vc120-mt-gd-1_57.lib
libboost_math_c99l-vc120-mt-gd-1_57.lib
libboost_math_tr1-vc120-mt-gd-1_57.lib
libboost_math_tr1f-vc120-mt-gd-1_57.lib
libboost_math_tr1l-vc120-mt-gd-1_57.lib
libboost_mpi-vc120-mt-gd-1_57.lib
libboost_prg_exec_monitor-vc120-mt-gd-1_57.lib
libboost_program_options-vc120-mt-gd-1_57.lib
libboost_random-vc120-mt-gd-1_57.lib
libboost_regex-vc120-mt-gd-1_57.lib
libboost_serialization-vc120-mt-gd-1_57.lib
libboost_signals-vc120-mt-gd-1_57.lib
libboost_system-vc120-mt-gd-1_57.lib
libboost_test_exec_monitor-vc120-mt-gd-1_57.lib
libboost_thread-vc120-mt-gd-1_57.lib
libboost_timer-vc120-mt-gd-1_57.lib
libboost_unit_test_framework-vc120-mt-gd-1_57.lib
libboost_wave-vc120-mt-gd-1_57.lib
libboost_wserialization-vc120-mt-gd-1_57.lib
flann_cpp_s-gd.lib
qhullstatic_d.lib
vtkalglib-6.2-gd.lib
vtkChartsCore-6.2-gd.lib
vtkCommonColor-6.2-gd.lib
vtkCommonComputationalGeometry-6.2-gd.lib
vtkCommonCore-6.2-gd.lib
vtkCommonDataModel-6.2-gd.lib
vtkCommonExecutionModel-6.2-gd.lib
vtkCommonMath-6.2-gd.lib
vtkCommonMisc-6.2-gd.lib
vtkCommonSystem-6.2-gd.lib
vtkCommonTransforms-6.2-gd.lib
vtkDICOMParser-6.2-gd.lib
vtkDomainsChemistry-6.2-gd.lib
vtkexoIIc-6.2-gd.lib
vtkexpat-6.2-gd.lib
vtkFiltersAMR-6.2-gd.lib
vtkFiltersCore-6.2-gd.lib
vtkFiltersExtraction-6.2-gd.lib
vtkFiltersFlowPaths-6.2-gd.lib
vtkFiltersGeneral-6.2-gd.lib
vtkFiltersGeneric-6.2-gd.lib
vtkFiltersGeometry-6.2-gd.lib
vtkFiltersHybrid-6.2-gd.lib
vtkFiltersHyperTree-6.2-gd.lib
vtkFiltersImaging-6.2-gd.lib
vtkFiltersModeling-6.2-gd.lib
vtkFiltersParallel-6.2-gd.lib
vtkFiltersParallelImaging-6.2-gd.lib
vtkFiltersProgrammable-6.2-gd.lib
vtkFiltersSelection-6.2-gd.lib
vtkFiltersSMP-6.2-gd.lib
vtkFiltersSources-6.2-gd.lib
vtkFiltersStatistics-6.2-gd.lib
vtkFiltersTexture-6.2-gd.lib
vtkFiltersVerdict-6.2-gd.lib
vtkfreetype-6.2-gd.lib
vtkftgl-6.2-gd.lib
vtkGeovisCore-6.2-gd.lib
vtkgl2ps-6.2-gd.lib
vtkhdf5-6.2-gd.lib
vtkhdf5_hl-6.2-gd.lib
vtkImagingColor-6.2-gd.lib
vtkImagingCore-6.2-gd.lib
vtkImagingFourier-6.2-gd.lib
vtkImagingGeneral-6.2-gd.lib
vtkImagingHybrid-6.2-gd.lib
vtkImagingMath-6.2-gd.lib
vtkImagingMorphological-6.2-gd.lib
vtkImagingSources-6.2-gd.lib
vtkImagingStatistics-6.2-gd.lib
vtkImagingStencil-6.2-gd.lib
vtkInfovisCore-6.2-gd.lib
vtkInfovisLayout-6.2-gd.lib
vtkInteractionImage-6.2-gd.lib
vtkInteractionStyle-6.2-gd.lib
vtkInteractionWidgets-6.2-gd.lib
vtkIOAMR-6.2-gd.lib
vtkIOCore-6.2-gd.lib
vtkIOEnSight-6.2-gd.lib
vtkIOExodus-6.2-gd.lib
vtkIOExport-6.2-gd.lib
vtkIOGeometry-6.2-gd.lib
vtkIOImage-6.2-gd.lib
vtkIOImport-6.2-gd.lib
vtkIOInfovis-6.2-gd.lib
vtkIOLegacy-6.2-gd.lib
vtkIOLSDyna-6.2-gd.lib
vtkIOMINC-6.2-gd.lib
vtkIOMovie-6.2-gd.lib
vtkIONetCDF-6.2-gd.lib
vtkIOParallel-6.2-gd.lib
vtkIOParallelXML-6.2-gd.lib
vtkIOPLY-6.2-gd.lib
vtkIOSQL-6.2-gd.lib
vtkIOVideo-6.2-gd.lib
vtkIOXML-6.2-gd.lib
vtkIOXMLParser-6.2-gd.lib
vtkjpeg-6.2-gd.lib
vtkjsoncpp-6.2-gd.lib
vtklibxml2-6.2-gd.lib
vtkmetaio-6.2-gd.lib
vtkNetCDF-6.2-gd.lib
vtkNetCDF_cxx-6.2-gd.lib
vtkoggtheora-6.2-gd.lib
vtkParallelCore-6.2-gd.lib
vtkpng-6.2-gd.lib
vtkproj4-6.2-gd.lib
vtkRenderingAnnotation-6.2-gd.lib
vtkRenderingContext2D-6.2-gd.lib
vtkRenderingContextOpenGL-6.2-gd.lib
vtkRenderingCore-6.2-gd.lib
vtkRenderingFreeType-6.2-gd.lib
vtkRenderingFreeTypeOpenGL-6.2-gd.lib
vtkRenderingGL2PS-6.2-gd.lib
vtkRenderingImage-6.2-gd.lib
vtkRenderingLabel-6.2-gd.lib
vtkRenderingLIC-6.2-gd.lib
vtkRenderingLOD-6.2-gd.lib
vtkRenderingOpenGL-6.2-gd.lib
vtkRenderingVolume-6.2-gd.lib
vtkRenderingVolumeOpenGL-6.2-gd.lib
vtksqlite-6.2-gd.lib
vtksys-6.2-gd.lib
vtktiff-6.2-gd.lib
vtkverdict-6.2-gd.lib
vtkViewsContext2D-6.2-gd.lib
vtkViewsCore-6.2-gd.lib
vtkViewsInfovis-6.2-gd.lib
vtkzlib-6.2-gd.lib
然后稍等一会儿,就会发现代码中的红色波浪线消失,但是此时你如果运行还是会出错的,因为配置环境变量后必须重启计算机才有效。
5、重启计算机
6、运行刚刚建立的工程,得到下图:
感谢您的阅读,希望我的博文能给你带来帮助!
本文为原创,转载务必注明出处,谢谢!