When use function 'pcl::io::vtkPolyDataToPointCloud' in PCL 1.6.0, one may have error as follows:

 

1>demo.obj : error LNK2001: unresolved external symbol "void __cdecl pcl::io::vtkPolyDataToPointCloud(class vtkPolyData * const,class pcl::PointCloud &)" (??$vtkPolyDataToPointCloud@UPointXYZRGB@pcl@@@io@pcl@@YAXQAVvtkPolyData@@AAV?$PointCloud@UPointXYZRGB@pcl@@@1@@Z)

1>G:\projects\demo\demo.exe : fatal error LNK1120: 1 unresolved externals

 

This happens because function 'pcl::io::vtkPolyDataToPointCloud' has not been integrated in 'pcl_io_release.lib' library, instead it is implemented in the file 'vtk_lib_io.hpp', so we need to include both the header file and the hpp file:

 

#include

#include

#include

 

查看原文