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

Include headers which is in an external package

asked 2012-04-20 05:54:35 -0600

moyashi gravatar image

updated 2012-04-20 07:32:08 -0600

AHornung gravatar image

Hello, I'd like to ask how to include headers in an external package. I created a package as followings.

・package name: test
  #ifndef _TEST
  #define _TEST
 #include <iostream>
 void test(void);
  #include "test/test.hpp"

  void test(void)
    std::cout << "test\n";

I added "rosbuild_add_libraries(test src/test.cpp)" in the manifest.xml for it and lib/ was successfully created.

In this case, how do I should include header "test.hpp" in other packages ? I added "<depend package="test"/> in manifest.xml in other packages, however rosmake failed. What should I do?

Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2012-04-20 07:34:32 -0600

AHornung gravatar image

updated 2012-04-20 07:35:47 -0600

You need put your include path into the export tag of the manifest of "test" as well. See and cflags in the <export>-Tag documentation.

edit flag offensive delete link more

answered 2013-03-26 07:51:59 -0600

captnPlan3t gravatar image

For anyone else that ends up here, see:

For an example solution.

edit flag offensive delete link more

Question Tools


Asked: 2012-04-20 05:54:35 -0600

Seen: 1,252 times

Last updated: Mar 26 '13