Using custom interface for another package but getting build error: No such file or directory

I created an custom action interface on my own machine following the course ROS2 Basics in 5 Days (C++). It build without errors, and when i use the command ros2 interface show custom_interfaces/action/Stitching, it is showing the correct information about the interface.

I wanted to use this interface now for building an action server. But there i get the following error:

Starting >>> stitching_action_server
--- stderr: stitching_action_server                             
~/ros2_ws/src/stitching_action_server/src/stitching_action_server.cpp:8:10: fatal error: custom_interfaces/action/stitching.hbb: No such file or directory
    8 | #include "custom_interfaces/action/stitching.hbb"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/stitching_action_server_node.dir/build.make:76: CMakeFiles/stitching_action_server_node.dir/src/stitching_action_server.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/stitching_action_server_node.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed   <<< stitching_action_server [0.39s, exited with code 2]

I would appreciate any help!
Tanks in advance!

Hi @TimSch ,

I did not take a deep look into your error, but I just looked at the #include line. You have written .hbb instead of .hpp. Probably that is what is causing you the problem.

Replace #include "custom_interfaces/action/stitching.hbb"
with #include "custom_interfaces/action/stitching.hpp"

Hopefully that should fix your issue. Let me know if your issue is fixed!


1 Like

@girishkumar.kannan tanks a lot! That’s a little bit embarrassing :smiley:

Hi @TimSch ,

Glad to know your issue is fixed. Please mark the post as “Solution” so this issue can be closed.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.