"No rule to make target" build error in ROS2

asked 2018-05-22 04:05:52 -0500

aks gravatar image

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 ?

edit retag flag offensive close merge delete

Comments

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 ?

aks gravatar image aks  ( 2018-05-22 04:42:39 -0500 )edit

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!

marguedas gravatar image marguedas  ( 2018-05-29 02:21:14 -0500 )edit