catkin_make编译ROS中pointcloud_to_laserscan模块报

error: expected constructor, destructor, or type conversion before ‘(’ token
  241 | PLUGINLIB_DECLARE_CLASS(pointcloud_to_laserscan, PointCloudToLaserScanNodelet, pointcloud_to_laserscan::PointCloudToLaserScanNodelet, nodelet::Nodelet);
      |                        ^
make[2]: *** [CMakeFiles/pointcloud_to_laserscan.dir/build.make:63:CMakeFiles/pointcloud_to_laserscan.dir/src/pointcloud_to_laserscan_nodelet.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1677:CMakeFiles/pointcloud_to_laserscan.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2

错误。

解决方法:

将该处代码修改为:

PLUGINLIB_EXPORT_CLASS(pointcloud_to_laserscan::PointCloudToLaserScanNodelet, nodelet::Nodelet);

注意原始代码中的宏是PLUGINLIB_DECLARE_CLASS,而修改后的是PLUGINLIB_EXPORT_CLASS。

相关文章:

  • 2022-12-23
  • 2021-05-26
  • 2021-06-07
  • 2021-06-11
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2018-05-16
  • 2022-02-07
  • 2021-05-20
  • 2021-08-28
  • 2021-07-19
  • 2021-11-06
相关资源
相似解决方案