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

  • 重新编译即可

相关推荐
Siren_dream11 分钟前
在VMware上运行Linux(我选择的是Ubuntu)
linux·运维·ubuntu
☆璇18 分钟前
【Linux】Socket编程UDP
linux·网络·udp
嵌入式小能手41 分钟前
飞凌嵌入式ElfBoard-Vim编辑器之Vim常用操作命令
linux·编辑器·vim
迷路爸爸1801 小时前
源码编译安装最新 tmux 教程(含 Debian/Ubuntu/CentOS/Arch/macOS 等系统)
linux·ubuntu·macos·centos·debian·tmux·archlinux
励志不掉头发的内向程序员1 小时前
【Linux系列】掌控 Linux 的脉搏:深入理解进程控制
linux·运维·服务器·开发语言·学习
東雪蓮☆1 小时前
K8s Ingress 详解与部署实战
linux·运维·kubernetes
望获linux1 小时前
【实时Linux实战系列】实时 Linux 在边缘计算网关中的应用
java·linux·服务器·前端·数据库·操作系统
聆风吟º2 小时前
无需 VNC / 公网 IP!用 Docker-Webtop+cpolar,在手机浏览器远程操控 Linux
linux·运维·docker
deng-c-f2 小时前
Linux C/C++ 学习日记(22):Reactor模式(二):实现简易的webserver(响应http请求)
linux·c语言·网络编程·reactor·http_server
BTU_YC2 小时前
CentOS 7 虚拟IP配置指南:使用传统network-scripts实现高可用
linux·tcp/ip·centos