前几天看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文件,在<build_depend>roscpp</build_depend>前面加上<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>catkin</buildtool_depend>
保存退出,再
cd ~/catkin_ws
catkin_make
就编译成功了