"No rule to make target" build error in ROS2
I have a .cpp
file named as heatConduction1.cpp
in which the node is named as heatConduction1
. This is working. Now i created another file as heatConduction2.cpp
in which i created a new node as heatConduction2
. I have added this in the CmakeLists.txt
as custom_executable(topics heatConduction1)
custom_executable(topics heatConduction2)
But I get an error while using ament build --symlink-install --only-package demo_nodes_cpp
as make[2]: *** No rule to make target 'CMakeFiles/heatConduction2.dir/build'. Stop.
CMakeFiles/Makefile2:617: recipe for target 'CMakeFiles/heatConduction2.dir/all' failed
make[1]: *** [CMakeFiles/heatConduction2.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I do not understand why ?
If I rename the 2nd cpp file to any other name e.g.
heatTest.cpp
, it works...Strange ! Are there here any conflicts with the naming conventions ?Can you please provide more information like where you located your newly created files, (in the
src/topics
folder?) as well as the content of your CMakeLists.txt and of your new files so that we can reproduce the issue ? Thanks!