PCL_1.7.0_MSVC2010_32bit安装编译指南

来源:互联网 发布:淘宝拖鞋女 编辑:程序博客网 时间:2024/06/11 10:43
1、下载PCL1.7.0源码
TortoiseSVN->checkout, URL:http://svn.pointclouds.org/pcl/trunk/

2、安装依赖库boost必须是1.49.0,或者复制依赖库绿色版到指定目录,并在环境变量中设置如下变量:
BOOST_ROOT
EIGEN_ROOT
FLANN_ROOT
VTK_DIR
QHULL_ROOT

3、编译pcl
cmake,可选择需要编译的应用和示例

4、VS2010编译PCL

必须编译Debug和Release两个版本。

问题:
...\VC\include\utility(163): error C2664:
LINK : fatal error LNK1104: 无法打开文件“..\lib\pcl_recognition_debug.lib” 
解决方案:
修改工程pcl_recognition的recognition/src/ransac_based/obj_rec_ransac.cpp文件如下:
删去540行: pair<set<ordered_int_pair>::iterator, bool> res = ordered_hypotheses_ids.insert (id_pair);
改为:pair<set<ordered_int_pair, bool(*)(const ordered_int_pair&, const ordered_int_pair&)>::iterator, bool> res = ordered_hypotheses_ids.insert (id_pair); 

重新编译。

编译完成后:

设置环境变量: PCL_ROOT

5.编译自己的程序
   5.1. 编写程序,如project_inliers.cpp
   5.2. 编写CMakeLists.txt,实例如下:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(project_inliers)
find_package(PCL 1.6 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (project_inliers project_inliers.cpp)
target_link_libraries (project_inliers ${PCL_LIBRARIES})
    5.3. 使用cmake-gui编译
    5.4. 使用VS2010打开project_inliers.sln工程
    5.5. 右键->属性->链接器->输入,去掉QT依赖库链接。
    5.6. 编译。
    5.7. 运行,打开cmd.exe,命令“cd /D 地址”,命令“project_inliers.exe”运行。