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

  • 重新编译即可

相关推荐
代码AC不AC17 小时前
【Linux】线程概念
linux·线程
神奇小梵18 小时前
关于finalshell的使用
linux·服务器·网络
vortex518 小时前
进程管理器大横评:从 PM2 到 Systemd 的选型与实战
linux·shell·进程管理
Yana.nice18 小时前
/etc/rhsm/rhsm.conf配置文件解析
linux
Jurio.18 小时前
Codex cli 分屏并行运行
linux·ai·远程工作·codex
dangdanding18 小时前
防火墙 IP 分片测试套件-fragroute
linux·网络·网络协议·tcp/ip
happymade18 小时前
全网拓扑自动发现与服务器全维度监控的技术实践
linux·运维·服务器·网络·zabbix·路由器·prometheus
米高梅狮子19 小时前
01.CentOS-Stream-8-packstack安装OpenStack
linux·云原生·容器·kubernetes·centos·自动化·openstack
xiaoye-duck19 小时前
《Linux系统编程》Linux基础开发工具 (二):详解自动化构建 make / Makefile
linux
cui_ruicheng19 小时前
Linux网络编程(五):基于UDP实现DictServer
linux·服务器·网络·udp