Ask Your Question
3

Eclipse and catkin problems (symbol could not be resolved)

asked 2013-07-22 04:42:29 -0600

thomas3687 gravatar image

updated 2014-01-28 17:17:22 -0600

ngrennan gravatar image

Hi all,

unfortunately i ran into some problems when trying to debug my rospackage in Eclipse (Kepler).

I followed these instructions in terminal:

  1. catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles" (in my catkin workspace)
  2. source ~/catkin_ws/devel/setup.bash
  3. eclipse

Then importing the project to eclipse works also fine.

But editing one file in the [Source directory]/myPackage/src/talker.cpp result in these errors, for example for this line of code:

ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);

i recieve these errors:

-symbol advertised could not be resolved
-Invalid arguments ' Candidates are: ros::Publisher advertise(const ? &, unsigned int, bool) ros::Publisher advertise(ros::AdvertiseOptions &) ros::Publisher advertise(const ? &, unsigned int, const boost::function<void (const ros::SingleSubscriberPublisher &)> &, const boost::function<void (const ros::SingleSubscriberPublisher &)> &, const boost::shared_ptr<const void> &, bool) ' talker.cpp  /Project-Debug@build/[Source directory]/rosgui/src  line 83 Semantic Error

also eclipse can't find: #include <sstream>

this is what i tried so far:

  • running cmake ./src -DCMAKE_BUILD_TYPE=Debug (in my catkin_workspace)
  • rebuilding the indexer in eclipse
  • tried it with eclipse Indigo

here the include paths in eclipse properties:

#ROS_BUILD_SHARED_LIBS=1
#ROS_PACKAGE_NAME="rosgui"
/usr/src/gtest
/home/thomas/catkin_ws/devel/include
/home/thomas/catkin_ws/src/rosgui/include
/opt/ros/groovy/include
/usr/include

Thank your very much for any advice!!

edit retag flag offensive close merge delete

Comments

3 Answers

Sort by ยป oldest newest most voted
1

answered 2013-07-28 12:21:45 -0600

barcelosandre gravatar image

You should include those paths:

/usr/include/c++/4.6

/usr/include/c++/4.6/x86_64-linux-gnu

/usr/include/c++/4.6/backward

edit flag offensive delete link more

Comments

Did not work for me (Ubuntu 12.04 64bit, Eclipse Kepler, ROS Hydro)

Markus Bader gravatar imageMarkus Bader ( 2014-01-27 22:39:31 -0600 )edit

It works for me. (Ubuntu 12.04 64bit, Eclipse Kepler, ROS Hydro) Thanks!

gurou gravatar imagegurou ( 2014-06-16 05:35:37 -0600 )edit
4

answered 2013-10-02 15:14:26 -0600

renaud gravatar image

updated 2013-10-02 15:15:28 -0600

I had the same problem. Here's the solution:

  1. Open Preferences
  2. Go to C/C++ -> Indexer
  3. Uncheck "Allow heuristic resolution of includes" and click OK
  4. Right-click on your project
  5. Click Index -> Rebuild

Cheers!

edit flag offensive delete link more

Comments

Did not work for me (Ubuntu 12.04 64bit, Eclipse Kepler, ROS Hydro)

Markus Bader gravatar imageMarkus Bader ( 2014-01-27 22:40:17 -0600 )edit

It worked for me. (Ubuntu 12.04 64bit, Eclipse Kepler, ROS Hydro) Thanks!

atp gravatar imageatp ( 2014-06-03 12:29:09 -0600 )edit

It works for me. (Ubuntu 12.04 64bit, Eclipse Kepler, ROS Hydro) Thanks!

gurou gravatar imagegurou ( 2014-06-16 05:36:06 -0600 )edit

Didn't work for me on Ubuntu 14.04 and ROS Indigo. Still have unresolved errors, on ROS_INFO for example.

Cyril_J gravatar imageCyril_J ( 2015-11-24 04:53:25 -0600 )edit
0

answered 2017-06-19 03:51:40 -0600

ran314 gravatar image

I had a similar problem. For some reason, the src folder wasn't properly included by eclipse project as a source folder.

To fix it:

  1. Right click project
  2. Select C/C++ Project Paths on the left
  3. Select the source Tab on the right, click Add Folder

Hope it is useful for someone else.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-07-22 04:42:29 -0600

Seen: 3,548 times

Last updated: Oct 02 '13