首先介绍一下,我的电脑配置是win32,win7系统,
VS2012
pcl是网上下载的PCL1.7.2 All-In-One安装包,这里pcl安装在E:\PCL\PCL 1.7.2\PCL 1.7.2
PCL配置参考点击打开链接
链接:http://pan.baidu.com/s/1c1cuurQ 密码:pxts
下面就是解压文件,利用VS2012打开,注意打开之前,最好先删除debug文件夹里面的.dll文件
打开后会发现,代码中有很多红线,不用怕,按照我说的步骤,一步步就可以解决
资源管理器--属性--VC++目录--包含目录:
添加包含目录:
添加库目录:
这时你会发现,程序中的红线已经消失了。
如果你这个时候,运行程序,你会发现还是有错误,错误如下:
这是为什么呢?查看附加依赖项。会发现里面的依赖项都是如上出现的错误。
解决办法是,把这些附加依赖项全部删除,然后添加和你版本对应的依赖项,这里我直接贴出我添加的依赖项
---------> 注意 <----------- !!!!!! 查看一下,你的libboost的版本,跟下面的版本是否一样!!!!!!
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然后应用,确定。不过最好在运行前,电脑重启一下, 因为配置环境变量后必须重启计算机才有效
好的,这样以后,你会发现运行误报错。运行成功!如下图所示: