ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

How to ensure make eclipse-project grabs all dependencies

asked 2011-08-02 00:33:10 -0500

tom gravatar image

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

ngrennan gravatar image

I've been struggling with this a couple of times before and always found work-arounds to overcome, but there must be a better way.

I develop my ROS-related code with Eclipse. So I always use make eclipse-project to create and update .project file as described on the IDEs ROS Wiki page. The problem is, make eclipse-project doesn't usually automatically grab package dependencies between packages I wrote.

I never have any problems with dependencies between packages installed from binary packages. But the weird thing is I never have any problems with eg. crawling trough packages I wrote with roscd or using other ros CLI commands to explore my package tree neither. So ROS_PACKAGE_PATH is set correctly. I also edited manifest.xml to add

<depend package="my_package"/>

so that should be right as well. But then I check Project properties -> C/C++ Include Paths and Preprocessor Symbols and the required package includes are missing.

What are the common pitfalls I can be dealing with?

EDIT: OK I think a probable cause of my problems is me not knowing anything about the correct usage of the <export> tag in the manifest.xml file. Is this the only documentation to it?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2011-08-02 21:43:08 -0500

tom gravatar image

updated 2011-08-02 21:43:40 -0500

OK, it's definitely it, after adding compiler and linker flags in manifest.xml all works fine. It also seems the only documentation to it is the one stated in the question, so a certain knowledge of makefile syntax is assumed. I, for instance, added this:

<export>
    <cpp cflags="-I${prefix}/src" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lMyLib"/>
</export>

This will cause my header files from src to be exported (I'm not following the convention to place header files in an include directory, so maybe you'll have to replace src with include), a library directory added to linker's knowledge and a library libMyLib.so (or .o) placed in one of the above declared directories to be linked.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-08-02 00:33:10 -0500

Seen: 731 times

Last updated: Aug 02 '11