Robotics StackExchange | Archived questions

missing header file of dependend package

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 adddependencies(packageB packageAgeneratemessagescpp). 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

Asked by inflo on 2016-05-06 08:51:11 UTC

Comments

Answers

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.

Asked by spmaniato on 2016-05-06 15:49:14 UTC

Comments