pcl环境搭建

测试了好多个版本,各种编译不通过,主要在cmake报错时解决不掉。

现在记录一下1.8.1的安装流程。

下载1.8.1 for 2017的all in one包和pdb

https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.8.1/PCL-1.8.1-AllInOne-msvc2017-win64.exe

https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.8.1/pcl-1.8.1-pdb-msvc2017-win64.zip

设置环境变量 ,之后一定要重启

PCL_ROOTC:\Program Files\PCL 1.8.1
Path;%PCL_ROOT%\bin
;%OPENNI2_REDIST64% (或%OPENNI2_REDIST%)
cmake主要参考

http://pointclouds.org/documentation/tutorials/using_pcl_pcl_config.php


最基本的 CMakeLists.txt for PCL


cmake_minimum_required( VERSION 2.8 )
 
# Create Project
project( solution )
add_executable( project main.cpp )
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
 
# Find Packages
find_package( PCL 1.8 REQUIRED )
 
if( PCL_FOUND )
  # Additional Include Directories
  # [C/C++]>[General]>[Additional Include Directories]
  include_directories( ${PCL_INCLUDE_DIRS} )
 
  # Preprocessor Definitions
  # [C/C++]>[Preprocessor]>[Preprocessor Definitions]
  add_definitions( ${PCL_DEFINITIONS} )
  #add_definitions( -DPCL_NO_PRECOMPILE )
 
  # Additional Library Directories
  # [Linker]>[General]>[Additional Library Directories]
  link_directories( ${PCL_LIBRARY_DIRS} )
 
  # Additional Dependencies
  # [Linker]>[Input]>[Additional Dependencies]
  target_link_libraries( project ${PCL_LIBRARIES} )
endif()
cmake编译时主要会报找不到路径的错,手动更正和检查环境变量




发布了22 篇原创文章 · 获赞 8 · 访问量 1万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览