一、问题描述
在catkin_make时候报错:
error: expected constructor, destructor, or type conversion before ‘(’ token
PLUGINLIB_DECLARE_CLASS(uvc_camera, CameraNodelet, uvc_camera::CameraNodelet, nodelet::Nodelet);
二、解决办法:
在uvc_camera的源码中/uvc_camera/src/nodelets.cpp 中找到
PLUGINLIB_DECLARE_CLASS(uvc_camera, CameraNodelet, uvc_camera::CameraNodelet, nodelet::Nodelet);
PLUGINLIB_DECLARE_CLASS(uvc_camera, StereoNodelet, uvc_camera::StereoNodelet, nodelet::Nodelet)
把这两行改成:
PLUGINLIB_EXPORT_CLASS(uvc_camera::CameraNodelet , nodelet::Nodelet);
PLUGINLIB_EXPORT_CLASS(uvc_camera::StereoNodelet , nodelet::Nodelet);
参考:
https://blog.youkuaiyun.com/lowbob/article/details/108909168
本文解决了在使用catkin_make时遇到的错误:expected constructor, destructor, or type conversion before ‘(’ token。通过修改uvc_camera源码中的PLUGINLIB声明方式为EXPORT_CLASS,成功解决了编译问题。
2762

被折叠的 条评论
为什么被折叠?



