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

Header usage among packages

asked 2011-07-07 23:41:03 -0600

Jeroen gravatar image

I'm having a problem including an header file from another package.

In package package_a I have created an header file and I want to include it in package_b. I thought this should be possible using

#include <package_a/header.hpp>

I also have the dependency included in the manifest. I'm getting the error that there is no such file or directory. It's probably a linking/library issue but I'm not familiar with linking.

I'm using this header file to share some definitions (constants) among packages, so if there is an (better) alternative solution feel free to share.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-07-07 23:43:54 -0600

dornhege gravatar image

updated 2011-07-07 23:44:31 -0600

You need to export the include and possibly linker flags of the header in its manifest.

edit flag offensive delete link more


Right. Here's an example. It goes in package_a's manifest file and assumes you have your includes in package_a's include directory: <export> <cpp cflags="-I${prefix}/include"/> </export>
seanarm gravatar image seanarm  ( 2011-07-08 01:45:49 -0600 )edit

Question Tools


Asked: 2011-07-07 23:41:03 -0600

Seen: 348 times

Last updated: Jul 07 '11