使用 PCL 的 BreadthFirstIterator 时出现 LNK2001 错误

use*_*335 0 c++ lnk2001 point-cloud-library

这是我的代码 pcl::octree::OctreePointCloud::BreadthFirstIterator tree_depth_it; 的代码 pcl::octree::OctreePointCloud::BreadthFirstIterator tree_depth_it_end = octree.breadth_end();

for (tree_depth_it = octree.breadth_begin(); tree_depth_it != tree_depth_it_end; ++tree_depth_it)
{
    if (tree_depth_it.isLeafNode()){...
Run Code Online (Sandbox Code Playgroud)

显示错误

错误 1 ​​错误 LNK2001:无法解析的外部符号“public: class pcl::octree::OctreeBreadthFirstIterator > & __cdecl pcl::octree::OctreeBreadthFirstIterator >::operator++(void)” (??E?$OctreeBreadthFirstIterator@V?$OctreeBase@ VOctreeContainerPointIndices@octree@pcl@@VOctreeContainerEmpty@23@@octree@pcl@@@octree@pcl@@QEAAAEAV012@XZ) C:\Pathe\Octree.obj manipulability_core

当我使用 OctreePointCloudSearch 时没有任何错误,但自从我添加了 BreadthFirstIterator 代码后,错误就会出现。我已经链接了标准 pcl_octree_debug.lib、boosts lib 和杂项 pcl 库,但我仍然无法消除该错误。

use*_*335 5

从日本网站找到了我的问题的答案,

来源:http ://d.hatena.ne.jp/takmin/comment?date=20130719

显然您需要在代码中插入以下行

#include <pcl/octree/octree_impl.h>
Run Code Online (Sandbox Code Playgroud)

供任何使用 PCL 时遇到 LNK200X 问题的人参考