----------------------2020-3-4更新--------------------------
链接:https://pan.baidu.com/s/136zV6pJ-Ya62k6NmUr0m6g
提取码:7gyl
-------------------------------------------------------------------
文章用到的所有软件均提供百度网盘下载
链接如果失效了,请留言评论我即使修改
链接:https://pan.baidu.com/s/1HiC_mHLcGwi2FvDKGc8-PA
提取码:rv9l (链接已失效,请使用更新的链接)
第一步安装VS2017
运行vs_community__1842138813.1519046694.exe
经过漫长的下载,进入到如下安装界面:
按照下面的勾选,如果你要开发其他语言也可以适当勾选:
点击右下角的安装即可开始漫长的下载安装,然后重启电脑就安装成功了VS。
接下来安装opencv,不需要opencv的可以直接跳到PCL的安装部分
我们的opencv版本是3.4.1,因此运行opencv-3.4.1-vc14_vc15.exe:程序开始在目录下解压。解压后是这样的:
我将他复制到了E:\Program Files\opencv下
然后第一步:开始配置环境变量:
找到此电脑->右键->属性->高级系统设置->环境变量
找到系统变量中的path变量,
将你opencv文件夹中的E:\Program Files\opencv\build\x64\vc14\bin路径添加到当中。路径根据你解压的位置进行变化就行了,下面也是相同的,这边就不再说了。
然后一路确定。
第二步,将动态库放到系统目录下:
将bin目录下面的opencv_world341.dll和opencv_world341d.dll文件复制到C:\Windows\SysWOW64这个文件夹里面即可
将bin目录里面的opencv_ffmpeg341_64.dll复制到C:\Windows\System32这个文件夹里面
这边参考了King_LJames 的文章。原文链接:https://blog.csdn.net/qq_41175905/article/details/805604
然后打开VS,新建一个项目:(第一次打开可能需要登录,没有微软账号的注册一个就好啦。不登陆微软账号,过一段时间VS就不能用了。)
视图->其他窗口->属性管理器
发现在右侧多出来了属性管理器
我们在这里只对debug进行配置,下面也是一样的不再赘述。双击Debug | x64 下面的Microsoft.Cpp.x64.user,在VC++目录->包含目录中写上下面的三条:
E:\Program Files\opencv\build\include
E:\Program Files\opencv\build\include\opencv
E:\Program Files\opencv\build\include\opencv2
库目录处加入
E:\Program Files\opencv\build\x64\vc14\lib
在右侧附加依赖项加入
opencv_world341d.lib
然后一路确定,最后记得把x86换成x64就好啦
OpenCV就算装好了。下面进行PCL的安装。
我们用的PCL版本是1.8.1,下面是安装包。
PCL-1.8.1-AllInOne-msvc2017-win64.exe
安装的过程没什么好说的,但是特别注意下以下几个选项
要把PCL添加进系统变量中
我安装的地方放到了E盘和opencv一样
这两个一定要都勾上
然后就是漫长的安装过程。
安装OpenNI同样修改安装路径,然后点击Install
安装结束
接下来在刚刚的VS中的工程中进行配置。
双击Debug | x64 下面的Microsoft.Cpp.x64.user
VC++目录的包含目录
E:\Program Files\PCL 1.8.1\include\pcl-1.8
E:\Program Files\PCL 1.8.1\3rdParty\VTK\include\vtk-8.0
E:\Program Files\PCL 1.8.1\3rdParty\Qhull\include
E:\Program Files\PCL 1.8.1\3rdParty\OpenNI2\Include
E:\Program Files\PCL 1.8.1\3rdParty\FLANN\include
E:\Program Files\PCL 1.8.1\3rdParty\Boost\include\boost-1_64
E:\Program Files\PCL 1.8.1\3rdParty\Eigen\eigen3
一共7个路径,数对了。
然后是库目录
E:\Program Files\PCL 1.8.1\3rdParty\OpenNI2\Lib
E:\Program Files\PCL 1.8.1\3rdParty\VTK\lib
E:\Program Files\PCL 1.8.1\3rdParty\Qhull\lib
E:\Program Files\PCL 1.8.1\3rdParty\FLANN\lib
E:\Program Files\PCL 1.8.1\3rdParty\Boost\lib
E:\Program Files\PCL 1.8.1\lib
一共6个路径。
然后是连接器-输入-附加依赖项,把下面这一堆都加进去:
kernel32.lib;
user32.lib;
gdi32.lib;
vtknetcdf_c++-gd.lib;
pcl_common_debug.lib;
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_ply_debug.lib
pcl_io_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_numpy3-vc141-mt-gd-1_64.lib
libboost_numpy-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_python3-vc141-mt-gd-1_64.lib
libboost_python-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
flann-gd.lib
flann_cpp-gd.lib
flann_cpp_s-gd.lib
flann_s-gd.lib
qhull_d.lib
qhullcpp_d.lib
qhullstatic_d.lib
qhullstatic_r_d.lib
qhull_p_d.lib
qhull_r_d.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
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
opengl32.lib
在属性目录"C/C++ "– >“预处理器”–>“预处理器定义” 加入:
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS
PCL_NO_PRECOMPILE
“C/C++”->“SDL检查”->“常规”:改为否(/sdl)
“C/C++”->“高级”->禁用特定警告中,加上4996
将E:\Program Files\PCL 1.8.1\bin下所有的dll文件复制到C:\Windows\SysWOW64
大功告成!