error: undefined reference to `pcl::visualization::PCLVisualizer::createActorFromVTKDataSet()'
im using ros noetic and pcl1.9.1 on ubuntu 20.04, i added below codes and catkin_make:
pcl::PointCloud<pcl::PointXYZI>::Ptr to_show(new pcl::PointCloud<pcl::PointXYZI>);
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer(new pcl::visualization::PCLVisualizer("viewer"));
viewer->setBackgroundColor (0, 0, 0);
viewer->addCoordinateSystem (1.0f);
pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZI> h1(to_show, 255, 0, 0);
viewer->addPointCloud(to_show, h1, "h1");
while(!viewer->wasStopped()){
viewer->spinOnce(100);
}
and then occured an error:
undefined reference to `pcl::visualization::PCLVisualizer::createActorFromVTKDataSet(vtkSmartPointer<vtkDataSet> const&, vtkSmartPointer<vtkLODActor>&, bool)'
i have already included all c++ source files releated i can find to my code, but it still cant build successfully. Does anybody else has the same issue? Can someone tell me which c++ file the implementation of "createActorFromVTKDataSet()" locate at?
Thanks!