操作系统:ubuntu20.04
链接: B站链接:【Autolabor初级教程】ROS机器人入门
问题
-- ==> add_subdirectory(learning_topic)
CMake Error at learning_topic/CMakeLists.txt:57 (add_message_files):
Unknown CMake command "add_message_files".
-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/guyueju1/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/guyueju1/build/CMakeFiles/CMakeError.log".
Makefile:768: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
解决办法
经检查,在 CMakeLists.txt文件中的find_packag函数中忘了增加对message_generation的依赖,修改完后编译成功.