I keep having the same issue, over and over again, and dunno what’s wrong!
this is the error:
/home/user/catkin_ws/src/service_server_pkg/src/bb8_move_in_square_service_client.cpp:3:55: fatal error: service_server_pkg/MyCustomServiceMessage.h: No such file or directory
service_server_pkg/CMakeFiles/bb8_move_in_square_service_client.dir/build.make:62: recipe for target ‘service_server_pkg/CMakeFiles/bb8_move_in_square_service_client.dir/src/bb8_move_in_square_service_client.cpp.o’ failed
make: *** [service_server_pkg/CMakeFiles/bb8_move_in_square_service_client.dir/src/bb8_move_in_square_service_client.cpp.o] Error 1
CMakeFiles/Makefile2:476: recipe for target ‘service_server_pkg/CMakeFiles/bb8_move_in_square_service_client.dir/all’ failed
make: *** [service_server_pkg/CMakeFiles/bb8_move_in_square_service_client.dir/all] Error 2
Makefile:138: recipe for target ‘all’ failed
make: *** [all] Error 2
Invoking “make -j2 -l2” failed
I had the same issue for the topic messages too, saying file not found while doing catkin_make.
make sure your CMakeLists.txt and package.xml are set up properly you can copy/paste most settings from other tutorials, but be careful to not copy the 2nd line, defining the package.
make sure your scripts are executable with “chmod +x ‘filename’”
after catkin_make, make sure to source ~/catkin_ws/devel/setup.bash in EVERY shell you want to use
I’m doing this in python, so might not be 100% the same, but perhaps it helps
I do agree with the steps indicated by @simon.steinmann91 I think Simon nailed it!
Please @buzatuionelia follow his advice and let us know if that works (or not)
Thanks a lot @simon.steinmann91, @rtellez. Is nice getting support on the 15th of August.
I managed to solve it by watching this video https://www.youtube.com/watch?v=jlj-9101pXQ.
I just had to add add_dependencies(source_file_name package_name_generate_messages_cpp) in the CMakeLists.txt file.
Still remains a mystery why all the repos I checked and all the code I saw before getting mad to solve it, no one had this piece of line within their code.
Read the tutorial carefully. Sometimes when there is a task, read a bit further, as important information is explained. It explicitly tells you if you should NOT look further down and try it yourself.