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

missing header file of dependend package

asked 2016-05-06 08:51:11 -0500

inflo gravatar image

updated 2016-05-06 09:18:49 -0500

hi, i got one package with only msg files inside. This package builds well and i can find the resulting header files in devel/include/packageA/mymessage.h

When i build a second package where i include #include "packageA/mymessage.h" and try to build it, it returns, that it cannot find the packageA/mymessage.h file, but in the catkin_ws/devel/include/ folder it is ?

do i need to add a add_dependencies() statement in packageB's CMakeLists.txt file ? and what should be inside it, the packageA file ?

EDIT1: it seemed that i need to add add_dependencies(packageB packageA_generate_messages_cpp). But packageB can still not find the header files of packageA . ??

EDIT2: in CMakeLists.txt of packageB i added into the find_package() statement the name of packageA, Now it builds everything

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-05-06 15:49:14 -0500

spmaniato gravatar image

updated 2016-05-06 15:52:21 -0500

You need the following dependency in CMakeLists.txt:

add_dependencies(packageB packageA_gencpp)

Here's an example from the navigation stack:

add_dependencies(move_base geometry_msgs_gencpp)

and also add packageA to packageB's manifest (package.xml) as a build and run dependency.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-05-06 08:51:11 -0500

Seen: 147 times

Last updated: May 06 '16