catkin_make编译错误

CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

execute_process(/home/jiangyulin/catkin_ws/build/catkin_generated/env_cached.sh
“/usr/bin/python2” “/usr/bin/empy” “–raw-errors” “-F”
“/home/jiangyulin/catkin_ws/build/learning_topic/cmake/learning_topic-genmsg-context.py”
“-o”
“/home/jiangyulin/catkin_ws/build/learning_topic/cmake/learning_topic-genmsg.cmake”
“/opt/ros/melodic/share/genmsg/cmake/pkg-genmsg.cmake.em”) returned error
code 1
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand)
learning_topic/CMakeLists.txt:80 (generate_messages)

– Configuring incomplete, errors occurred!
See also “/home/jiangyulin/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/jiangyulin/catkin_ws/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

麻烦会的小伙伴交流一,谢谢

看起来是构建msgs的时候挂掉了。

错误信息提示并不算友好,没有指出来你写的用户程序的位置。

“/home/jiangyulin/catkin_ws/build/learning_topic/cmake/learning_topic-genmsg.cmake”

错误提示中的这个文件是一个线索。可以顺着这个找一下。

简单的方法是删除掉 build/ 和 devel/ 看看是否重现。

如果重现,检查下 msgs 的相关的文件是否写的格式不对。