编译错误:

/home/star/rikirobot/catkin_ws/src/depth_camera/depthimage_to_laserscan/src/DepthImageToLaserScanNodelet.cpp:60:24: error: expected constructor, destructor, or type conversion before ‘(’ tokenPLUGINLIB_DECLARE_CLASS(depthimage_to_laserscan, DepthImageToLaserScanNodelet, depthimage_to_laserscan::DepthImageToLaserScanNodelet, nodelet::Nodelet);^
depth_camera/depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/build.make:62: recipe for target 'depth_camera/depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/src/DepthImageToLaserScanNodelet.cpp.o' failed
make[2]: *** [depth_camera/depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/src/DepthImageToLaserScanNodelet.cpp.o] Error 1
CMakeFiles/Makefile2:6307: recipe for target 'depth_camera/depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/all' failed
make[1]: *** [depth_camera/depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j1" failed


出现错误的原因是ubuntu18.04 ros melodic版本与ubuntu16.04 ros kinetic版本中,pluginlib库函数发生了变化。
解决方法:
未修改前的代码:

修改为:

PLUGINLIB_EXPORT_CLASS(depthimage_to_laserscan::DepthImageToLaserScanNodelet, nodelet::Nodelet)

再次编译,即可成功

error: expected constructor, destructor, or type conversion before ‘(’ token PLUGINLIB_DECLARE_CLAS相关推荐

  1. error: expected constructor, destructor, or type conversion before '.' token

    今天写代码是遇到这样一个问题error: expected constructor, destructor, or type conversion before '.' token:立马网上查,原来是 ...

  2. 笔记error: expected constructor, destructor, or type conversion before ‘.‘ token

    error: expected constructor, destructor, or type conversion before '.' token 找了半天原因,原来是犯了基础知识不扎实的错误, ...

  3. Error:expected constructor ,destructor, or type conversion before ‘(‘ token

    在全局声明了一个结构体,随即对其进行memset(),出现如题的报错信息. C++中,全局域只能声明.初始化变量: 不能用于赋值.运算.调用函数 错误代码: #include <studio.h ...

  4. 【错误】expected constructor, destructor, or type conversion before '.' token - 第八个游侠的日志 - 网易博客...

    [错误]expected constructor, destructor, or type conversion before '.' token - 第八个游侠的日志 - 网易博客 [错误]expe ...

  5. C++编程 expected constructor, destructor, or type conversion before '(' token

    这是一个编译错误,其含意是:在字符 '(' 之前,应该是一个构造函数.析构函数或是类型转换等标识.编译程序现在在'('之前缺少必要的标识符,故提示错误.给你一个例子: int *p; p = new ...

  6. error: expected constructor, destructor, or typ...

    2019独角兽企业重金招聘Python工程师标准>>> error: expected constructor, destructor, or type conversion bef ...

  7. JSON parse error: No suitable constructor found for type

    错误信息: 2019-02-19 09:17:58,678 [http-nio-8080-exec-1] WARN org.springframework.web.servlet.mvc.suppor ...

  8. Android Studio之Error:(158) Error: Expected resource of type id [ResourceType]

    Android Studio在输出apk包时,在检查代码规范性方面相比Eclipse要严格得多,以下代码可在Eclipse编译通过, Android Studio控制台报错:Error:(158) E ...

  9. Runtime error: expected scalar type Float but found Double

    错误:Runtime error: expected scalar type Float but found Double w_true=torch.tensor([2,-3.4]).T b_true ...

最新文章

  1. zabbix 监控tomcat实例
  2. 元宇宙的“42条共识”
  3. 后MATLAB时代的七种开源替代,一种堪称完美!
  4. import win32api 安装pip install pypiwin32
  5. java求数组的最小值_JAVA编程求数组最大值和最小值
  6. 为什么不应该使用(长期存在的)功能分支
  7. python怎么处理文字_python 处理给规范的文字
  8. 终于找到了满意的博客主题
  9. jsonobject json对象里面_「jsonobject」用JSONObject解析和处理json数据 - seo实验室
  10. 简单干净的C#方法设计案例:SFCUI.AjaxValue()之三
  11. 关于MySQL分表操作的研究
  12. ES6系列_2之新的声明方式
  13. RMI、RPC、SOAP通信技术介绍及比对
  14. 基于HTML/CSS/JS的动态元素周期表
  15. 一篇SCI论文最快多久能完成?
  16. 打印机的系统是linux吗,linux下打印机的配置和使用
  17. VMware提示【该虚拟机似乎正在使用中】的解决方案
  18. 【防骗】来电显示号码竟可任意修改
  19. Kahan summation
  20. MobileNet网络学习笔记

热门文章

  1. 计算机网络之基本概念
  2. Python 逻辑运算符优先级(not,and,or)
  3. 折半查找判定树的高度-思路分享
  4. 美的COLMO冰箱凭借硬核黑科技,荣膺行业唯一AI 营养健康品牌奖项
  5. 智能开放搜索上线定制分词器
  6. CleanMyMacParagon NTFS黑五秒杀继续 薅毛继续
  7. Vmware 12 和CentOS 7 镜像下载
  8. JS逆向 2021-8-15 七麦 analysis参数
  9. 三维数学基础之坐标系、向量、矩阵
  10. ubuntu 切换root用户界面登录