CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not

在进行ROS编译 catkin_make 时,缺少数据包文件 std_msgs

bruce@bruce-desktop:~/catkin_ws$ catkin_make

出现错误

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "std-msgs" with any
  of the following names:

    std-msgsConfig.cmake
    std-msgs-config.cmake

  Add the installation prefix of "std-msgs" to CMAKE_PREFIX_PATH or set
  "std-msgs_DIR" to a directory containing one of the above files.  If
  "std-msgs" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  test_pkg/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/bruce/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/bruce/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

因为缺少文件,(亲测),

从新安装一遍ROS,

不必卸载原来的ROS,再编译,问题解决。

还有遇见的一些主要问题:

问题1:
bruce@bruce-desktop:~$ sudo rosdep init


ERROR: default sources list file already exists:
	/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
按要求删除文件
bruce@bruce-desktop:~$ su root
Password: 

root@bruce-desktop:/home/bruce# pwd
/home/bruce

root@bruce-desktop:/# cd  /etc/ros/rosdep/sources.list.d/
root@bruce-desktop:/etc/ros/rosdep/sources.list.d# ls -l
total 4
-rw-r--r-- 1 root root 588 11月 25 19:11 20-default.list
root@bruce-desktop:/etc/ros/rosdep/sources.list.d# rm 20-default.list
root@bruce-desktop:/etc/ros/rosdep/sources.list.d# 

问题2:

再次创建 test_pkg文件时,出现一些错误,按照提示,删除相应文件即可。

bruce@bruce-desktop:~/catkin_ws$ cd src
bruce@bruce-desktop:~/catkin_ws/src$ catkin_create_pkg test_pkg std_msgs rospy roscpp

usage: catkin_create_pkg [-h] [--meta] [-s [SYS_DEPS [SYS_DEPS ...]]]
                         [-b [BOOST_COMPS [BOOST_COMPS ...]]] [-V PKG_VERSION]
                         [-D DESCRIPTION] [-l LICENSE] [-a AUTHOR]
                         [-m MAINTAINER] [--rosdistro ROSDISTRO]
                         name [dependencies [dependencies ...]]
catkin_create_pkg: error: File exists: /home/bruce/catkin_ws/src/test_pkg/CMakeLists.txt
bruce@bruce-desktop:~/catkin_ws/src$ 
打开/home/bruce/catkin_ws/src/test_pkg/ ,删除 CMakeLists.txt 文件。有的可能要登录root。
  • 3
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值