1、下载文件
两个文件PCL-1.8.1-AllInOne-msvc2015-win64.exe和pcl-1.8.1-pdb-msvc2015-win64.zip。链接:
Release pcl-1.8.1 · PointCloudLibrary/pcl · GitHub
2、安装PCL1.8.1
选择第二项,为所有用户添加路径。删除目标文件夹的空格
3、点击安装
安装过程中会弹出窗口提示安装OpenNI,将OpenNI的安装路径更改为自己选定的安装PCL的第三方库(3rdparty文件夹)的路径下。安装过程有窗口警告提示你路径太长的错误提示,点击确定不影响,之后自己在环境变量里面配置即可。
4、解压下载的PCL-1.8.1-pdb-msvc2015-win64.zip
将里面的文件全部复制到PCL安装路径下bin文件夹中
5、新建6个环境变量,重启电脑。
%PCL_ROOT\bin %PCL_ROOT%\3rdParty\VTK\bin %PCL_ROOT\3rdParty\FLANN\bin %OPENNI2_REDIST64% %PCL_ROOT%\3rdParty\Qhull\bin %PCL_ROOT%\3rdParty\OpenNI2\Tools |
6、配置系统环境变量
7、打开vs2015,新建控制台应用程序,项目名称为pclTest
找到属性管理器,在Release|x64右击选择第一项“添加新项目属性表”,命名为:PCLRelease64
在PCLRelease64右击选择属性或者双击属性表
包括目录:
D:\Program\PCL1_8_1\include D:\Program\PCL1_8_1\3rdParty\Boost\include\boost-1_64 D:\Program\PCL1_8_1\3rdParty\Eigen\eigen3 D:\Program\PCL1_8_1\3rdParty\FLANN\include D:\Program\PCL1_8_1\3rdParty\OpenNI2\Include D:\Program\PCL1_8_1\3rdParty\Qhull\include D:\Program\PCL1_8_1\3rdParty\VTK\include\vtk-8.0 |
库目录:
D:\Program\PCL1_8_1\lib D:\Program\PCL1_8_1\3rdParty\Boost\lib D:\Program\PCL1_8_1\3rdParty\FLANN\lib D:\Program\PCL1_8_1\3rdParty\OpenNI2\Lib D:\Program\PCL1_8_1\3rdParty\Qhull\lib D:\Program\PCL1_8_1\3rdParty\VTK\lib |
附加依赖项:
pcl_common_release.lib pcl_features_release.lib pcl_filters_release.lib pcl_io_release.lib pcl_io_ply_release.lib pcl_kdtree_release.lib pcl_keypoints_release.lib pcl_ml_release.lib pcl_octree_release.lib pcl_outofcore_release.lib pcl_people_release.lib pcl_recognition_release.lib pcl_registration_release.lib pcl_sample_consensus_release.lib pcl_search_release.lib pcl_segmentation_release.lib pcl_stereo_release.lib pcl_surface_release.lib pcl_tracking_release.lib pcl_visualization_release.lib libboost_atomic-vc140-mt-1_64.lib libboost_chrono-vc140-mt-1_64.lib libboost_container-vc140-mt-1_64.lib libboost_context-vc140-mt-1_64.lib libboost_coroutine-vc140-mt-1_64.lib libboost_date_time-vc140-mt-1_64.lib libboost_exception-vc140-mt-1_64.lib libboost_filesystem-vc140-mt-1_64.lib libboost_graph-vc140-mt-1_64.lib libboost_iostreams-vc140-mt-1_64.lib libboost_locale-vc140-mt-1_64.lib libboost_log-vc140-mt-1_64.lib libboost_log_setup-vc140-mt-1_64.lib libboost_math_c99-vc140-mt-1_64.lib libboost_math_c99f-vc140-mt-1_64.lib libboost_math_c99l-vc140-mt-1_64.lib libboost_math_tr1-vc140-mt-1_64.lib libboost_math_tr1f-vc140-mt-1_64.lib libboost_math_tr1l-vc140-mt-1_64.lib libboost_mpi-vc140-mt-1_64.lib libboost_prg_exec_monitor-vc140-mt-1_64.lib libboost_program_options-vc140-mt-1_64.lib libboost_random-vc140-mt-1_64.lib libboost_regex-vc140-mt-1_64.lib libboost_serialization-vc140-mt-1_64.lib libboost_signals-vc140-mt-1_64.lib libboost_system-vc140-mt-1_64.lib libboost_test_exec_monitor-vc140-mt-1_64.lib libboost_thread-vc140-mt-1_64.lib libboost_timer-vc140-mt-1_64.lib libboost_unit_test_framework-vc140-mt-1_64.lib libboost_wave-vc140-mt-1_64.lib libboost_wserialization-vc140-mt-1_64.lib vtkalglib-8.0.lib vtkChartsCore-8.0.lib vtkCommonColor-8.0.lib vtkCommonComputationalGeometry-8.0.lib vtkCommonCore-8.0.lib vtkCommonDataModel-8.0.lib vtkCommonExecutionModel-8.0.lib vtkCommonMath-8.0.lib vtkCommonMisc-8.0.lib vtkCommonSystem-8.0.lib vtkCommonTransforms-8.0.lib vtkDICOMParser-8.0.lib vtkDomainsChemistry-8.0.lib vtkexoIIc-8.0.lib vtkexpat-8.0.lib vtkFiltersAMR-8.0.lib vtkFiltersCore-8.0.lib vtkFiltersExtraction-8.0.lib vtkFiltersFlowPaths-8.0.lib vtkFiltersGeneral-8.0.lib vtkFiltersGeneric-8.0.lib vtkFiltersGeometry-8.0.lib vtkFiltersHybrid-8.0.lib vtkFiltersHyperTree-8.0.lib vtkFiltersImaging-8.0.lib vtkFiltersModeling-8.0.lib vtkFiltersParallel-8.0.lib vtkFiltersParallelImaging-8.0.lib vtkFiltersPoints-8.0.lib vtkFiltersProgrammable-8.0.lib vtkFiltersSelection-8.0.lib vtkFiltersSMP-8.0.lib vtkFiltersSources-8.0.lib vtkFiltersStatistics-8.0.lib vtkFiltersTexture-8.0.lib vtkFiltersTopology-8.0.lib vtkFiltersVerdict-8.0.lib vtkfreetype-8.0.lib vtkGeovisCore-8.0.lib vtkgl2ps-8.0.lib vtkhdf5-8.0.lib vtkhdf5_hl-8.0.lib vtkImagingColor-8.0.lib vtkImagingCore-8.0.lib vtkImagingFourier-8.0.lib vtkImagingGeneral-8.0.lib vtkImagingHybrid-8.0.lib vtkImagingMath-8.0.lib vtkImagingMorphological-8.0.lib vtkImagingSources-8.0.lib vtkImagingStatistics-8.0.lib vtkImagingStencil-8.0.lib vtkInfovisCore-8.0.lib vtkInfovisLayout-8.0.lib vtkInteractionImage-8.0.lib vtkInteractionStyle-8.0.lib vtkInteractionWidgets-8.0.lib vtkIOAMR-8.0.lib vtkIOCore-8.0.lib vtkIOEnSight-8.0.lib vtkIOExodus-8.0.lib vtkIOExport-8.0.lib vtkIOExportOpenGL-8.0.lib vtkIOGeometry-8.0.lib vtkIOImage-8.0.lib vtkIOImport-8.0.lib vtkIOInfovis-8.0.lib vtkIOLegacy-8.0.lib vtkIOLSDyna-8.0.lib vtkIOMINC-8.0.lib vtkIOMovie-8.0.lib vtkIONetCDF-8.0.lib vtkIOParallel-8.0.lib vtkIOParallelXML-8.0.lib vtkIOPLY-8.0.lib vtkIOSQL-8.0.lib vtkIOTecplotTable-8.0.lib vtkIOVideo-8.0.lib vtkIOXML-8.0.lib vtkIOXMLParser-8.0.lib vtkjpeg-8.0.lib vtkjsoncpp-8.0.lib vtklibharu-8.0.lib vtklibxml2-8.0.lib vtklz4-8.0.lib vtkmetaio-8.0.lib vtkNetCDF-8.0.lib vtknetcdf_c++.lib vtkoggtheora-8.0.lib vtkParallelCore-8.0.lib vtkpng-8.0.lib vtkproj4-8.0.lib vtkRenderingAnnotation-8.0.lib vtkRenderingContext2D-8.0.lib vtkRenderingContextOpenGL-8.0.lib vtkRenderingCore-8.0.lib vtkRenderingFreeType-8.0.lib vtkRenderingGL2PS-8.0.lib vtkRenderingImage-8.0.lib vtkRenderingLabel-8.0.lib vtkRenderingLIC-8.0.lib vtkRenderingLOD-8.0.lib vtkRenderingOpenGL-8.0.lib vtkRenderingVolume-8.0.lib vtkRenderingVolumeOpenGL-8.0.lib vtksqlite-8.0.lib vtksys-8.0.lib vtktiff-8.0.lib vtkverdict-8.0.lib vtkViewsContext2D-8.0.lib vtkViewsCore-8.0.lib vtkViewsInfovis-8.0.lib vtkzlib-8.0.lib flann.lib flann_cpp.lib flann_cpp_s.lib flann_s.lib qhullcpp_d.lib qhullstatic.lib qhullstatic_r.lib qhull.lib qhull_p.lib qhull_r.lib OpenNI2.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib comctl32.lib wsock32.lib glu32.lib opengl32.lib ws2_32.lib Psapi.lib |
1、下载解压
下载地址 http://lastools.github.io/download/LAStools.zip
2、编译
2.1 打开
用VS2017打开lastools.dsw。历史原因,一直点确定就可以。
2.2 移除失败的项目
2.3 修改代码
打开LASlib的头文件mydefs.hpp,定位到69行,只保留 #if defined(_MSC_VER),删除或注释改行其它代码。
2.4 注
Win 10系统需要,右键LASlib—属性—配置属性—常规—Windows SDK 版本—选择合适的。
否则可能出现错误:找不到Windows SDK 版本8.1。请安装所需的版本的Windows SDK或者在项目属性页中或通过右键单击解决方案并选择”重定解决方案目标”来更改SDK版本。
2.5 修改输出目录
右键LASlib—属性—配置属性—常规—输出目录—修改为“$(SolutionDir)$(ProjectName)\$(Configuration)\”。
2.6 修改头文件目录
右键LASlib—配置属性—C/C++—常规—附加包含目录—删除“...\laszip\stl”
2.7 修改运行库
右键LASlib—属性—C/C++—代码生成—运行库—笔者选择“多线程DLL(/MD)”。(默认应该是多线程/MT)
2.8 生成lib
右键LASlib—重新生成。结果在 D:\LAStools\LASlib\Release\ LASlib.lib
3、项目配置
3.1 新建工程
(1)配置属性—常规—Windows SDK版本,与前者保持一致。
(2)配置属性—C/C++—代码生成—运行库,(默认)选择多选程DLL(/MD),与前者保持一致。
3.2 头文件目录
配置属性—C/C++—常规——附加包含目录,添加 D:\LAStools\LASlib\inc 和 D:\LAStools\LASzip\src
3.3 静态库
配置属性—链接器—输入—添加 D:\LAStools\LASlib\Release\LASlib.lib