Errors shown in Eclipse after importing the tutorial project

asked 2015-03-21 02:57:04 -0500

Pubudu gravatar image

I have followed the tutorial and ran it as well and everything works fine in the command line when I follow the instructions here.

I followed the steps to make an eclipse project and imported to eclipse. But once I import to eclipse and open the files, I see errors in the editor.

In listener.cpp

In the line

ROS_INFO("I heard: [%s]", msg->data.c_str());

I get the error

Invalid arguments '
Candidates are:
void initializeLogLocation(ros::console::LogLocation *, const ? &, enum ros::console::levels::Level)

In the line

  ros::init(argc, argv, "listener");

I get the error

Invalid arguments '
Candidates are:
void init(const ? &, const ? &, ?)
void init(int &, char * *, const ? &, ?)
'

In the line

  ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);

I get the error

Invalid arguments '
Candidates are:
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(#0), #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(ros::SubscribeOptions &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(#0)const, #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(const boost::shared_ptr<const #0> &), #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(const boost::shared_ptr<const #0> &)const, #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(#0), const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(#0)const, const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(const boost::shared_ptr<const #0> &), const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (#1::*)(const boost::shared_ptr<const #0> &)const, const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (*)(#0), const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, void (*)(const boost::shared_ptr<const #0> &), const ros::TransportHints &)
ros::Subscriber subscribe(const ? &, ?, const ? &, const ? &, const ros::TransportHints &)
'

There are similar error in the talker.cpp file as well. What could I be doing wrong? I'm using Eclipse 4.4.0 on Ubuntu 14.04 and using ros Indigo. When I right click the project and build it everything builds without any errors.

edit retag flag offensive close merge delete

Comments

I know that's an old question but I've faced the same issue. This answer helped me.

DmitryDzz gravatar image DmitryDzz  ( 2017-04-12 11:39:15 -0500 )edit