PCL LNK2001 unresolved external symbol EuclideanClusterExtraction extract()
I have been getting the following linker error when building with the Point Cloud Library (PCL 1.8.1) in Visual Studio 2017 – not at all sure why:
1 2 3 | Error LNK2001 unresolved external symbol "public: void __cdecl pcl::EuclideanClusterExtraction<struct pcl::PointNormal> ::extract(class std::vector<struct pcl::PointIndices,class std::allocator<struct pcl::PointIndices> > &)" (?extract@?$EuclideanClusterExtraction@UPointNormal@pcl@@@pcl@@QEAAXAEAV?$vector@UPointIndices@pcl@@V?$allocator@UPointIndices@pcl@@@std@@@std@@@Z) |
I found that to get rid of the linker error I needed to include:
1 | #include <pcl/segmentation/impl/extract_clusters.hpp> |
Again I am not sure why, and it is not usual to have to include impl/* files? – I may look into it a bit further if I get a chance but for now I am happy that my code links!