ROS2-Jazzy编译功能包报错

系统:ubuntu24.04

ROS2:Jazzy(鱼香ros一键安装)

问题:colcon build 时报错:

shell 复制代码
CMake Error at CMakeLists.txt:12 (find_package):
 By not providing "Findbase_interfaces_demo.cmake" in CMAKE_MODULE_PATH this
 project has asked CMake to find a package configuration file provided by
 "base_interfaces_demo", but CMake did not find one.

Could not find a package configuration file provided by
 "base_interfaces_demo" with any of the following names:

    base_interfaces_demoConfig.cmake
    base_interfaces_demo-config.cmake

Add the installation prefix of "base_interfaces_demo" to CMAKE_PREFIX_PATH
 or set "base_interfaces_demo_DIR" to a directory containing one of the
 above files. If "base_interfaces_demo" provides a separate development
 package or SDK, be sure it has been installed.

失败尝试:

  1. 尝试更新列表sudo apt update然后安装sudo apt install base_interfaces_demo(无法定位软件包)

最终解决办法:

  • find / -name "base_interfaces_demo" 2>/dev/null

    找到所有相关文件,在我的系统里找到这个包在:/home/lihaoting/.local/share/Trash/files/install/**目录下有

  • 打开.bashrc文件(一般是隐藏的,在家目录下ctrl + h 就能显示)

  • 在末尾添加export CMAKE_PREFIX_PATH=/home/lihaoting/.local/share/Trash/files/install:$CMAKE_PREFIX_PATH并保存退出

  • 重新编译即可

相关推荐
天夏已微凉1 小时前
1.3.2 linux音频PulseAudio详细介绍
linux·音视频
烦躁的大鼻嘎2 小时前
【Linux】深入拆解Ext文件系统:从磁盘物理结构到Linux文件管理
linux·运维·服务器·ubuntu·centos
成工小白2 小时前
【Linux】环境变量(图文)
linux·环境变量
YoungHong19922 小时前
Ubuntu通过源码编译方式单独安装python3.12
linux·运维·python·ubuntu
传知摩尔狮3 小时前
深入理解 Linux 虚拟文件系统(VFS)
linux·运维·服务器·性能优化
YBDDIE3 小时前
Linux中的防火墙
linux·服务器·网络
2401_858286113 小时前
OSE2.【Linux】练习:查找项目的main函数入口
linux·运维·服务器
舰长1153 小时前
docker 镜像的导出和导入(导出完整镜像和导出容器快照)
linux·运维·服务器
遇见火星4 小时前
Linux下Systemd服务的核心功能及列出 Systemd 服务的方法!
linux·运维·服务器·systemd
望获linux4 小时前
工业软件自主化突围:RTOS 如何打破 “协议栈 - 控制器” 生态垄断
linux·人工智能·操作系统·开源软件·嵌入式软件·工业软件