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$
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY