在Windows下使用pcl库

在学SLAM十四讲中第五讲需要使用PCL库将五张RGBD图片结合位姿信息生成点云.
需要的线性代数库之前就已经装好了,现在主要安装新的一讲需要的pcl库.
由于官网下的released版本太低了,于是去http://unanancyowen.com/en/pcl18/下载了1.8.0版本.我的opencv是x64的所以我下了"PCL 1.8.0 All-in-one Installer MSVC2015 x64"
安装过程中提醒我PATH变量过长不能自动添加,于是安装完毕后手动添加PCL 1.8.0\bin和OpenNI2\Tools进PATH.
在VS项目的VC++目录中包含目录添加:
PCL 1.8.0\include\pcl-1.8
PCL 1.8.0\3rdParty\Boost\include\boost-1_61
PCL 1.8.0\3rdParty\VTK\include\vtk-7.0
然后库目录添加:
PCL 1.8.0\lib
PCL 1.8.0\3rdParty\Boost\lib
PCL 1.8.0\3rdParty\VTK\bin
第三方库只加了这些是因为我只用到了这些.

按道理这样应该就可以用了,运行,但是出现报错:
错误 LNK2019 无法解析的外部符号 “void __cdecl cv::fastFree(void *)” (?fastFree@cv@@YAXPEAX@Z),该符号在函数 “public: __cdecl cv::Mat::~Mat(void)” (??1Mat@cv@@QEAA@XZ) 中被引用
等11个错误

一般这种错误是因为没有添加库目录的原因,但是我重新检查了之后发现都没问题,报错缺少的库也存在.
一番查找后试了下在属性页-连接器-输入-附加依赖项中添加:
PCL 1.8.0\lib\pcl_tracking_debug.lib
PCL 1.8.0\lib\pcl_surface_debug.lib
PCL 1.8.0\lib\pcl_sample_consensus_debug.lib
PCL 1.8.0\lib\pcl_registration_debug.lib
PCL 1.8.0\lib\pcl_octree_debug.lib
PCL 1.8.0\lib\pcl_keypoints_debug.lib
PCL 1.8.0\lib\pcl_kdtree_debug.lib
PCL 1.8.0\lib\pcl_io_debug.lib
PCL 1.8.0\lib\pcl_search_debug.lib
PCL 1.8.0\lib\pcl_segmentation_debug.lib
PCL 1.8.0\lib\pcl_features_debug.lib
PCL 1.8.0\lib\pcl_filters_debug.lib
PCL 1.8.0\lib\pcl_visualization_debug.lib
PCL 1.8.0\lib\pcl_common_debug.lib
然后这个问题就解决了.

还没完,最后(可能不是最后)就是:
warning STL4019: The member std::fpos::seekpos() is non-Standard, and is preserved only for compatibility with workarounds for old versions of Visual C++. It will be removed in a future release, and in this release always returns 0. Please use standards-conforming mechanisms to manipulate fpos, such as conversions to and from streamoff, or an integral type, instead. If you are receiving this message while compiling Boost.IOStreams, a fix has been submitted upstream to make Boost use standards-conforming mechanisms, as it does for other compilers. You can define _SILENCE_FPOS_SEEKPOS_DEPRECATION_WARNING to acknowledge that you have received this warning, or define _REMOVE_FPOS_SEEKPOS to remove std::fpos::seekpos entirely. SLAM d:\program files\pcl 1.8.0\3rdparty\boost\include\boost-1_61\boost\iostreams\positioning.hpp 96
看错误信息应该是boost库中使用了个弃用的方法还是什么的.
一番搜索无果后想办法自己解决:双击点进去导航到d:\program files\pcl 1.8.0\3rdparty\boost\include\boost-1_61\boost\iostreams\positioning.hpp 96行
将return pos.seekpos();改成return 0;

编译通过,运行报错:由于找不到OpenNI2.dll,无法继续执行代码…
检查了下环境变量,重启VS,成功运行.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值