Ask Your Question
1

Classes not resolved on Eclipse CDT

asked 2011-10-06 08:21:48 -0500

130s gravatar image

updated 2014-01-28 17:10:31 -0500

ngrennan gravatar image

(Hope this isn't overlapping with previous questions...)

On Eclipse, basic ROS files (e.g. ros::{ NodeHanle, Publisher } ) are not resolved. Is something wrong or missing in what I've done?

For example, while I'm doing this tutorial, I did followings (trying to follow IDEs page:

% roscreate-pkg drive_base_tutorial roscpp geometry_msgs
% make eclipse-project                (in the new folder)

Then add "Environment" (ROS_ROOT, ROS_PACKAGE_PATH, PYTHONPATH, PATH) on Eclipse (which was necessary for .cpp files to resolve .h files on Eclipse), then "Proejct"->"Build Project", which returns errors saying the classes are not resolved as mentioned earlier.

make from command line is successful.

I know how to manually add "include" path. I'm just wondering whether make eclipse-project isn't too nice to set include path and all other necessary configuration automatically or not, and the IDEs page can be read as it would do nice things I expect.

Environment: Ubuntu 10.10, Eclipse CDT Indigo

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-10-07 01:51:32 -0500

Achim gravatar image

You need to run make eclipse-project again each time that you change the project dependicies. Additionally you need to restart eclipse everytime you do that.

You should have the includes showing up in eclipse, if everything is correct.

edit flag offensive delete link more

Comments

@Achim thanks. Redoing "make eclipse-project" might have helped setting Environments so that include files are now able to be referred , but still classes like NodeHandle are not resolved...I can even open the files included via Eclipse by clicking file names in .cpp file. Strange.
130s gravatar image 130s  ( 2011-10-07 05:40:34 -0500 )edit
Though weird, I now can resolve, build and run on Eclipse the copied .cpp file from the one that had a problem. Original .cpp is still has problem but that doesn't matter. Still don't know what took the actual effect but thanks!
130s gravatar image 130s  ( 2011-10-07 09:31:19 -0500 )edit

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: 2011-10-06 08:21:48 -0500

Seen: 881 times

Last updated: Oct 07 '11