需求描述
在使用《点云库PCI学习教程》(北京航空航天大学出版社)第379页,无序点云的快速三角化部分代码时报如下错误:
error LNK2001: 无法解析的外部符号 "private: virtual void __thiscall pcl::GreedyProjectionTriangulation<struct pcl::PointNormal>::performReconstruction(class std::vector<struct pcl::Vertices,class std::allocator <struct pcl::Vertices> >&)"(?performReconstruction@?$GreedyProjectionTriangulation@UPointNormal@pcl@@@pcl@@EAEXAAV?$vector@UVertices@pcl@@V?$allocator@UVertices@pcl@@@std@@@std@@@Z)
error LNK2001: 无法解析的外部符号 "private: virtual void __thiscall pcl::GreedyProjectionTriangulation<struct pcl::PointNormal>::performReconstruction(struct pcl::PolygonMesh &)"(?performReconstruction@?$GreedyProjectionTriangulation@UPointNormal@pcl@@@pcl@@EAEXAAUPolygonMesh@2@@Z)
LINK1120: 2个无法解析的外部命令
错误代码位置
pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3; //定义三角化对象
解决方案
C:\Program Files (x86)\PCL 1.6.0\lib路径下(根据你自己的路径做出相应的调整)找到pcl_surface_debug.lib 文件。然后把pcl_surface_debug.lib添加到附加依赖项(项目属性→链接器→输入→附加依赖项)