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

How to include other package's headers?

asked 2012-02-09 23:02:30 -0500

sam gravatar image

updated 2012-02-10 16:10:32 -0500

I tried to create "A" and "B" package.

I added include/A/a.h on directory which "roscd A".

Then I use a.h in b.cpp and add manifest on package B:

 #include <A/a.h>

 int main()
    return 0;


   <description brief="B">


   <review status="unreviewed" notes=""/>
   <depend package="roscpp"/>
   <depend package="A"/>


But compile failed because of couldn't find A/a.h.

How to solve it?

Thank you~

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-10 00:30:23 -0500

Package A needs to export its headers. Add this to its manifest.xml file:

  <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib"/>

For more info see the XML Reference

edit flag offensive delete link more

Question Tools


Asked: 2012-02-09 23:02:30 -0500

Seen: 2,948 times

Last updated: Feb 10 '12