PCL显示自定义点云类型报错 undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<MyPointType>

阅读 65

2022-03-30

简介: 我使用pcl-1.8在可视化自定义的点云类型时,出现以下报错:

undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<MyPointType>
::PointCloudGeometryHandlerXYZ(boost::shared_ptrpcl::PointCloud\
<MyPointType const> const&)'

报错截图如下:

解决方法:

在包含头文件时添加如下两个文件:

#include <pcl/visualization/point_cloud_geometry_handlers.h>
#include <pcl/visualization/impl/point_cloud_geometry_handlers.hpp>

问题分析:

根据报错信息来看是缺少对pcl::visualization::PointCloudGeometryHandlerXYZ<PointXYZIL>::PointCloudGeometryHandlerXYZ(boost::shared_ptr<pcl::PointCloud<PointXYZIL> const> const&)的定义,因为我自定义了自己的点云类型,这里可能会有影响,深层的原因还不清楚。

精彩评论(0)

0 0 举报