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

  • 重新编译即可

相关推荐
淮北4942 分钟前
计算机网络学习(六、应用层)
linux·学习·计算机网络
lew-yu27 分钟前
【已解决】Linux中程序脚本可以手动执行成功,但加在rc.local中不能开机自启
linux·服务器
ajassi200029 分钟前
linux C 语言开发 (四) linux系统常用命令
linux·运维·服务器
小嵌同学33 分钟前
Linux:malloc背后的实现细节
大数据·linux·数据库
EveryPossible1 小时前
如何终止画图
linux·编辑器·vim
wangjialelele2 小时前
Linux匿名管道和命名管道以及共享内存
linux·运维·网络
禁默2 小时前
Linux 之从硬件硬盘到文件系统的全面过渡
linux·运维·服务器
塵觴葉3 小时前
Linux内核网络的连接跟踪conntrack简单分析
linux·网络·conntrack
m0_464608263 小时前
监控 Linux 服务器资源
linux
tongsound3 小时前
ros2 lifcycle介绍
linux·c++