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并保存退出

  • 重新编译即可

相关推荐
2401_892070981 天前
【Linux C++ 日志系统实战】LogFile 日志文件管理核心:滚动策略、线程安全与方法全解析
linux·c++·日志系统·日志滚动
lwx9148521 天前
Linux-Shell算术运算
linux·运维·服务器
somi71 天前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
双份浓缩馥芮白1 天前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
黄昏晓x1 天前
Linux ---- UDP和TCP
linux·tcp/ip·udp
路溪非溪1 天前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
此刻觐神1 天前
IMX6ULL开发板学习-01(Linux文件目录和目录相关命令)
linux·服务器·学习
2401_892070981 天前
【Linux C++ 日志系统实战】高性能文件写入 AppendFile 核心方法解析
linux·c++·日志系统·文件写对象
航Hang*1 天前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
-ONLY-¥1 天前
PostgreSQL运维全攻略:从基础操作到远程配置
linux