fatal error: rclcpp/rclcpp.hpp: No such file or directory
Hi, even after sourcing and all the path is included correctly, I get this error while I try to compile (few other projects compiles well from the same workspace directory that which includes rclcpp.hpp ) version-dashing on 18.04
/home/snvk/ros2_dashing/src/ros2_fr/src/fr_subscriber.cpp:2:10: fatal error: rclcpp/rclcpp.hpp: No such file or directory
include "rclcpp/rclcpp.hpp"
compilation terminated.
gmake[2]: *** [CMakeFiles/subscriber.dir/src/fr_subscriber.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/subscriber.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [all] Error 2
Failed <<< ros2_fr [ Exited with code 2 ]
Summary: 0 packages finished [3.39s]
1 package failed: ros2_fr
1 package had stderr output: ros2_fr
Thanks in advance
Could you show your
CMakeLists.txt
? Please remove all the boilerplate comments from it (lines starting with#
) before you post it.I don't see a problem with the CMakeLists.txt. Can you provide your package.xml as well?
The package.xml looks ok as well. But I just noticed that your compile error is for fr_subscriber.cpp. That isn't in your CMakeLists.txt. It only contains fr_publisher.cpp. Did you provide the wrong CMakeLists.txt? How does the fr_subscriber file get built?
Hi, Yes! sorry I just provided you the wrong
This CMakeLists.txt looks OK as well.
However, the files you've posted don't all match with your error messages. The project in the error message is ros2_fr, the project in the CMakeLists.txt is fr_ros2 and the project in the package.xml is frgen_ros2
Please make them consistent, and check you've posted the right files.