解决PCL MLS : error LNK2019; error LNK2001 virtual MovingLeastSquares process performProcessing问题
来源:互联网 发布:营销网络怎么填 编辑:程序博客网 时间:2024/06/06 10:51
PCL 基于多项式拟合的法线估计、点云平滑和数据重采样
在使用Window VS2010为开发平台,学习PCL点云库的时候,学到曲面重建(Surface)。在测试下面的程序的时候,遇到了问题。
#include <pcl/point_types.h>#include <pcl/io/pcd_io.h>#include <pcl/io/io.h>#include <pcl/io/ply_io.h>#include <pcl/kdtree/kdtree_flann.h>#include <pcl/surface/mls.h>#include <iostream>#include <pcl/visualization/cloud_viewer.h>#include <pcl/console/print.h>#include <pcl/console/parse.h>#include <pcl/console/time.h>using namespace std;using namespace pcl;using namespace pcl::io;using namespace pcl::console;intmain (int argc, char** argv){ cout << "Project Begin: " << endl; // Load input file into a PointCloud<T> with an appropriate type pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGBA> ()); // Load bun0.pcd -- should be available with the PCL archive in test pcl::io::loadPCDFile ("pcl_point_cloud/phase2d_1.pcd", *cloud); cout << "Read .pcd File Final. " << endl; cout << "This cloud Points number is :" << cloud->points.size() << endl; // Create a KD-Tree pcl::search::KdTree<pcl::PointXYZRGBA>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZRGBA>); // Output has the PointNormal type in order to store the normals calculated by MLS pcl::PointCloud<pcl::PointXYZRGBNormal> mls_points; // Init object (second point type is for the normals, even if unused) pcl::MovingLeastSquares<pcl::PointXYZRGBA, pcl::PointXYZRGBNormal> mls; mls.setComputeNormals (true); //Set parameters mls.setInputCloud(cloud); mls.setPolynomialFit(true); mls.setSearchMethod(tree); mls.setSearchRadius(.1); TicToc tt; tt.tic (); print_highlight ("Processing "); // Reconstruct mls.process(mls_points); print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms]\n"); cout << "Smoothing Processing cloud Points Final." << endl; std::cout << "After MLS , point cloud size is " << mls_points.size() << std::endl; // Save output pcl::io::savePCDFile ("phase2d-mls.pcd", mls_points); cout << "Save .PCD file Final !" << endl; cout << "New The New Cloud Points number is : " << mls_points.points.size() << endl; getchar(); return 0;}
VS2010编译这段程序的时候,出现了下面的链接错误:
1>Smoothing_Cloud.obj : error LNK2019: 无法解析的外部符号 "public: virtual void __thiscall pcl::MovingLeastSquares<struct pcl::PointXYZRGBA,struct pcl::PointXYZRGBNormal>::process(class pcl::PointCloud<struct pcl::PointXYZRGBNormal> &)" (?process@?$MovingLeastSquares@UPointXYZRGBA@pcl@@UPointXYZRGBNormal@2@@pcl@@UAEXAAV?$PointCloud@UPointXYZRGBNormal@pcl@@@2@@Z),该符号在函数 _main 中被引用1>Smoothing_Cloud.obj : error LNK2001: 无法解析的外部符号 "private: virtual void __thiscall pcl::MovingLeastSquares<struct pcl::PointXYZRGBA,struct pcl::PointXYZRGBNormal>::performProcessing(class pcl::PointCloud<struct pcl::PointXYZRGBNormal> &)" (?performProcessing@?$MovingLeastSquares@UPointXYZRGBA@pcl@@UPointXYZRGBNormal@2@@pcl@@EAEXAAV?$PointCloud@UPointXYZRGBNormal@pcl@@@2@@Z)1> fatal error LNK1120: 2 个无法解析的外部命令1>1>生成失败。
解决办法:
添加下面这个头文件:
#include <pcl/surface/impl/mls.hpp>
再次编译,问题解决。
参考网站:
http://docs.ros.org/hydro/api/pcl/html/mls_8hpp.html
http://d.hatena.ne.jp/takmin/comment?date=20130719
0 0
- 解决PCL MLS : error LNK2019; error LNK2001 virtual MovingLeastSquares process performProcessing问题
- 记录 error LNK2019 error LNK2001
- 【原创】error LNK2019: error LNK2001 错误
- Qt error LNK2019: error LNK2001: vs2010
- QT error LNK2001问题的解决
- error LNK2001的解决
- error LNK2019问题
- c++ error LNK2019问题
- error LNK2001 一些问题
- 【QT+VC】 error LNK2001: error LNK2019 的简单排错
- error LNK2019,error LNK2001:无法解析的外部符号
- [C++] 烦人的error LNK2019和error LNK2001
- Visual Studio---error LNK2001(或者error LNK2019)
- 解决 error LNK2019: 无法解析的外部符号 问题
- 解决 error LNK2019: 无法解析的外部符号 问题
- 问题error LNK2001: unresolved external symbol "public: static class解决
- OpenGL的 error LNK2019问题
- OpenGL链接问题 error LNK2019
- 线程池
- Fragment全解析系列(一):那些年踩过的坑
- Ubuntu 16.04 LTS 64位下安装steam游戏平台
- SpringMVC 通过post接收form参数或者json参数
- java并发机制之volatile详解
- 解决PCL MLS : error LNK2019; error LNK2001 virtual MovingLeastSquares process performProcessing问题
- Fragment全解析系列(二):正确的使用姿势
- SpringMVC如何接受POST请求中的json参数
- 算法/ACM汇总
- Fragment之我的解决方案:Fragmentation
- IEEE Xplore PDF-Checker遇到的问题以及解决方案
- CUDA入门(一)
- LeetCode进阶之路(Longest Palindromic Substring)
- Android N - Data Saver