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

  • 重新编译即可

相关推荐
van叶~2 小时前
Linux网络-------1.socket编程基础---(TCP-socket)
linux·网络·tcp/ip
风吹落叶花飘荡2 小时前
Ubuntu系统 系统盘和数据盘扩容具体操作
linux·运维·ubuntu
zoulingzhi_yjs2 小时前
haproxy配置详解
linux·云原生
bingbingyihao2 小时前
Node.js 模拟 Linux 环境
linux·node.js
大神的风范2 小时前
从0开始学linux韦东山教程Linux驱动入门实验班(5)
linux
小码过河.3 小时前
CentOS 搭建 Docker 私有镜像仓库
linux·docker·centos
贾斯汀玛尔斯4 小时前
ubuntu/centos系统ping 不通域名的解决方案
linux·ubuntu·centos
呆瑜nuage5 小时前
Linux的工具
linux
唐青枫6 小时前
Linux vimgrep 详解
linux·vim
麦子邪6 小时前
C语言中奇技淫巧04-仅对指定函数启用编译优化
linux·c语言·开发语言