Windows10/7 + Visual Studio 2013 + PCL1.8.0

来源:互联网 发布:第三方数据监测公司 编辑:程序博客网 时间:2024/06/05 00:09

最近在用PCL做点云的显示,分别在Windows10和Windows7环境下配置了PCL,配置过程中也查了参考了不少配置博主的配置过程,自己再重新整理一遍。

1.     下载安装PCL

PCL安装包链接: https://pan.baidu.com/s/1jIb1x0U 密码: 6kaa,根据系统选择安装包,我选择的PCL-1.8.0-AllInOne-msvc2013-win64版本


安装过程会弹出OpenNI2的安装,将OpenNI2安装在PCL安装目录下的3rdParty/OpenNI2里


2.  配置系统变量


3. 配置项目

新建项目,设置为64位


为了方便后期的使用,新建一个属性表,右键“添加新项目属性表”


双击新建的属性表 VC++目录-》包含目录


VC++目录-》库目录


链接器-》输入-》附加依赖库,添加以下信息

pcl_common_debug.libpcl_features_debug.libpcl_filters_debug.libpcl_io_debug.libpcl_io_ply_debug.libpcl_kdtree_debug.libpcl_keypoints_debug.libpcl_ml_debug.libpcl_octree_debug.libpcl_outofcore_debug.libpcl_people_debug.libpcl_recognition_debug.libpcl_registration_debug.libpcl_sample_consensus_debug.libpcl_search_debug.libpcl_segmentation_debug.libpcl_stereo_debug.libpcl_surface_debug.libpcl_tracking_debug.libpcl_visualization_debug.liblibboost_atomic-vc120-mt-gd-1_59.liblibboost_chrono-vc120-mt-gd-1_59.liblibboost_container-vc120-mt-gd-1_59.liblibboost_context-vc120-mt-gd-1_59.liblibboost_coroutine-vc120-mt-gd-1_59.liblibboost_date_time-vc120-mt-gd-1_59.liblibboost_exception-vc120-mt-gd-1_59.liblibboost_filesystem-vc120-mt-gd-1_59.liblibboost_graph-vc120-mt-gd-1_59.liblibboost_iostreams-vc120-mt-gd-1_59.liblibboost_locale-vc120-mt-gd-1_59.liblibboost_log-vc120-mt-gd-1_59.liblibboost_log_setup-vc120-mt-gd-1_59.liblibboost_math_c99-vc120-mt-gd-1_59.liblibboost_math_c99f-vc120-mt-gd-1_59.liblibboost_math_c99l-vc120-mt-gd-1_59.liblibboost_math_tr1-vc120-mt-gd-1_59.liblibboost_math_tr1f-vc120-mt-gd-1_59.liblibboost_math_tr1l-vc120-mt-gd-1_59.liblibboost_mpi-vc120-mt-gd-1_59.liblibboost_prg_exec_monitor-vc120-mt-gd-1_59.liblibboost_program_options-vc120-mt-gd-1_59.liblibboost_random-vc120-mt-gd-1_59.liblibboost_regex-vc120-mt-gd-1_59.liblibboost_serialization-vc120-mt-gd-1_59.liblibboost_signals-vc120-mt-gd-1_59.liblibboost_system-vc120-mt-gd-1_59.liblibboost_test_exec_monitor-vc120-mt-gd-1_59.liblibboost_thread-vc120-mt-gd-1_59.liblibboost_timer-vc120-mt-gd-1_59.liblibboost_unit_test_framework-vc120-mt-gd-1_59.liblibboost_wave-vc120-mt-gd-1_59.liblibboost_wserialization-vc120-mt-gd-1_59.libflann_cpp_s-gd.libflann_s-gd.libqhull-gd.libqhullcpp-gd.libqhullstatic-gd.libqhullstatic_r-gd.libqhull_p-gd.libqhull_r-gd.libvtkalglib-7.0-gd.libvtkChartsCore-7.0-gd.libvtkCommonColor-7.0-gd.libvtkCommonComputationalGeometry-7.0-gd.libvtkCommonCore-7.0-gd.libvtkCommonDataModel-7.0-gd.libvtkCommonExecutionModel-7.0-gd.libvtkCommonMath-7.0-gd.libvtkCommonMisc-7.0-gd.libvtkCommonSystem-7.0-gd.libvtkCommonTransforms-7.0-gd.libvtkDICOMParser-7.0-gd.libvtkDomainsChemistry-7.0-gd.libvtkDomainsChemistryOpenGL2-7.0-gd.libvtkexoIIc-7.0-gd.libvtkexpat-7.0-gd.libvtkFiltersAMR-7.0-gd.libvtkFiltersCore-7.0-gd.libvtkFiltersExtraction-7.0-gd.libvtkFiltersFlowPaths-7.0-gd.libvtkFiltersGeneral-7.0-gd.libvtkFiltersGeneric-7.0-gd.libvtkFiltersGeometry-7.0-gd.libvtkFiltersHybrid-7.0-gd.libvtkFiltersHyperTree-7.0-gd.libvtkFiltersImaging-7.0-gd.libvtkFiltersModeling-7.0-gd.libvtkFiltersParallel-7.0-gd.libvtkFiltersParallelImaging-7.0-gd.libvtkFiltersProgrammable-7.0-gd.libvtkFiltersSelection-7.0-gd.libvtkFiltersSMP-7.0-gd.libvtkFiltersSources-7.0-gd.libvtkFiltersStatistics-7.0-gd.libvtkFiltersTexture-7.0-gd.libvtkFiltersVerdict-7.0-gd.libvtkfreetype-7.0-gd.libvtkGeovisCore-7.0-gd.libvtkglew-7.0-gd.libvtkGUISupportQt-7.0-gd.libvtkGUISupportQtSQL-7.0-gd.libvtkhdf5-7.0-gd.libvtkhdf5_hl-7.0-gd.libvtkImagingColor-7.0-gd.libvtkImagingCore-7.0-gd.libvtkImagingFourier-7.0-gd.libvtkImagingGeneral-7.0-gd.libvtkImagingHybrid-7.0-gd.libvtkImagingMath-7.0-gd.libvtkImagingMorphological-7.0-gd.libvtkImagingSources-7.0-gd.libvtkImagingStatistics-7.0-gd.libvtkImagingStencil-7.0-gd.libvtkInfovisCore-7.0-gd.libvtkInfovisLayout-7.0-gd.libvtkInteractionImage-7.0-gd.libvtkInteractionStyle-7.0-gd.libvtkInteractionWidgets-7.0-gd.libvtkIOAMR-7.0-gd.libvtkIOCore-7.0-gd.libvtkIOEnSight-7.0-gd.libvtkIOExodus-7.0-gd.libvtkIOExport-7.0-gd.libvtkIOGeometry-7.0-gd.libvtkIOImage-7.0-gd.libvtkIOImport-7.0-gd.libvtkIOInfovis-7.0-gd.libvtkIOLegacy-7.0-gd.libvtkIOLSDyna-7.0-gd.libvtkIOMINC-7.0-gd.libvtkIOMovie-7.0-gd.libvtkIONetCDF-7.0-gd.libvtkIOParallel-7.0-gd.libvtkIOParallelXML-7.0-gd.libvtkIOPLY-7.0-gd.libvtkIOSQL-7.0-gd.libvtkIOVideo-7.0-gd.libvtkIOXML-7.0-gd.libvtkIOXMLParser-7.0-gd.libvtkjpeg-7.0-gd.libvtkjsoncpp-7.0-gd.libvtklibxml2-7.0-gd.libvtkmetaio-7.0-gd.libvtkNetCDF-7.0-gd.libvtkNetCDF_cxx-7.0-gd.libvtkoggtheora-7.0-gd.libvtkParallelCore-7.0-gd.libvtkpng-7.0-gd.libvtkproj4-7.0-gd.libvtkRenderingAnnotation-7.0-gd.libvtkRenderingContext2D-7.0-gd.libvtkRenderingContextOpenGL2-7.0-gd.libvtkRenderingCore-7.0-gd.libvtkRenderingFreeType-7.0-gd.libvtkRenderingImage-7.0-gd.libvtkRenderingLabel-7.0-gd.libvtkRenderingLOD-7.0-gd.libvtkRenderingOpenGL2-7.0-gd.libvtkRenderingQt-7.0-gd.libvtkRenderingVolume-7.0-gd.libvtkRenderingVolumeOpenGL2-7.0-gd.libvtksqlite-7.0-gd.libvtksys-7.0-gd.libvtktiff-7.0-gd.libvtkverdict-7.0-gd.libvtkViewsContext2D-7.0-gd.libvtkViewsCore-7.0-gd.libvtkViewsInfovis-7.0-gd.libvtkViewsQt-7.0-gd.libvtkzlib-7.0-gd.libOpenNI2.lib


4. 测试,新建一个cpp文件,输入以下内容,monkey.ply文件也在安装包所在的链接中

#include <iostream>#include <pcl\io\io.h>#include <pcl\io\ply_io.h>#include <pcl\point_types.h>#include <pcl\visualization\cloud_viewer.h>using namespace std;int main(){pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);pcl::io::loadPLYFile("monkey.ply", *cloud);pcl::visualization::CloudViewer viewer("Cloud viewer");viewer.showCloud(cloud);while (!viewer.wasStopped()){}return 0;}

编译并运行,报错


解决办法,在属性表中,配置属性-》C/C++-》预处理器-》预处理器定义-》_SCL_SECURE_NO_WARNINGS


编译并运行,报错,解决方法:设置完系统变量之后,要重启电脑


编译并运行,运行成功


原创粉丝点击