c++point-cloud-librarylnk2001

LNK2001 errors while using PCL's BreadthFirstIterator


Here's the code for my code 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()){...

Errors shown

Error 1 error LNK2001: unresolved external symbol "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

There wasnt any errors when I used OctreePointCloudSearch but ever since Ive added the BreadthFirstIterator code the error will show up. Ive linked the standard pcl_octree_debug.lib, boosts lib and misc pcl libs but still I am unable to get rid of the error.


Solution

  • Found the answer to my question from a japanese website,

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

    Apparently you need to insert the following line in your code

    #include <pcl/octree/octree_impl.h>
    

    A reference for anyone using PCL encountering any LNK200X problems