Ask Your Question
0

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
・include/test/test.hpp↓
  #ifndef _TEST
  #define _TEST
 #include <iostream>
 
 void test(void);
  #endif
・src/test.cpp↓
  #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/test.so 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
4

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 http://www.ros.org/wiki/Manifest and cflags in the <export>-Tag documentation.

edit flag offensive delete link more
2

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

captnPlan3t gravatar image

For anyone else that ends up here, see:

answers.ros.org/question/12972/how-to-include-other-packages-headers/

For an example solution.

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: 2012-04-20 05:54:35 -0600

Seen: 1,183 times

Last updated: Mar 26 '13