I just wanted to ask some clarifications to see if I understand this correctly.
The issue of this error :
The problem is that your C++ executable has not been compiled even if everything appears to be correctly setup.
The way I solve this issue is by using the project name the same as my executable file in which case :
Example:
If my executable file name is executable_file.cpp, then my PROJECT_NAME is also executable_file.
As taken from ROS official documentation:
add_dependencies(some_target ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
So, in my case, it is:
add_dependencies(executable_file ${executable_file_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
Is my understanding correct?
Also, I came across the solution where I have to either use :
rm -rf build/ devel/ //or even
catkin clean
to solve the issue of C++ file not compiling.
Why is that so? I avoided using catkin clean
as it gives me warning that it will delete the logs, build and devel directory which I dont know if it will cause an issue in the long run.