CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116 (message):catkin_package

前几天看ROS教程(三):创建程序包及节点(图文),想用ROS创建节点进行交互,结果catkin_make编译到80%的时候报错,CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116 (message):catkin_package() ‘catkin’ must be listed as a buildtool dependency in the package.xml,后面终于解决了。
首先

cd ~/catkin_ws/src
sudo gedit package.xml

修改packge.xml文件,在roscpp前面加上catkin

catkin

保存退出,再

cd ~/catkin_ws
catkin_make

就编译成功了
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116 (message):catkin_package_第1张图片

你可能感兴趣的:(ubuntu)