Package dependencies and include dirs
Hi all,
I have a package1 which generates services via a Type1.srv file. These generated services are located in <catkin_ws>/devel/include/package1/Type1.h. This all works fine.
Now when I want a package2 to also use the services generated in package1 I follow the steps described in here.
Now when building I get the following error:
... fatal error: package1/Type1.h: No such file or directory
#include "package1/Type1.h"
^
compilation terminated.
Now it turns out package1/Type1.h is well generated and does lie in devel/include/package1/Type1.h.
So I output the content of package1_FOUND, package1_INCLUDE_DIRS and catkin_INCLUDE_DIRS from package2's CMakeLists.txt and it reads:
package1_FOUND : 1
package1_INCLUDE_DIRS : /opt/ros/indigo/include/usr/include
catkin_INCLUDE_DIRS : /opt/ros/indigo/include/usr/include
I would expect to get ../devel/include for these values, no?
Anyone knows what I am missing here? How can I let my system know about the include path to devel/include? I guess I do not have to set these includes by hand, do I?
Kind regards,
Antoine.
No, for headers generated from msgs the include paths should be added automatically. It would help if you could include the relevant
CMakeLists.txt
(please without all the comments).Make sure you have the right dependencies listed in package.xml and CMakeLists.txt. If you don't have your package1 listed as a dependency, the include path will be wrong. As @gvdhoom points out, if you post them it would be easier for others to help you find what's wrong.