Could NOT find actionlib (missing: actionlib_DIR)

在执行CMake时出现:

cst@cst-ubuntu:~/catkin_ws1/src/actionlib_example_pkg$ cmake .

-- Using CATKIN_DEVEL_PREFIX: /home/cst/catkin_ws1/src/actionlib_example_pkg/devel

-- Using CMAKE_PREFIX_PATH: /home/cst/catkin_ws1/devel;/home/cst/catkin_ws/devel;/opt/ros/noetic

-- This workspace overlays: /home/cst/catkin_ws1/devel;/home/cst/catkin_ws/devel;/opt/ros/noetic

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3")

-- Using PYTHON_EXECUTABLE: /usr/bin/python3

-- Using Debian Python package layout

-- Using empy: /usr/lib/python3/dist-packages/em.py

-- Using CATKIN_ENABLE_TESTING: ON

-- Call enable_testing()

-- Using CATKIN_TEST_RESULTS_DIR: /home/cst/catkin_ws1/src/actionlib_example_pkg/test_results

-- Forcing gtest/gmock from source, though one was otherwise available.

-- Found gtest sources under '/usr/src/googletest': gtests will be built

-- Found gmock sources under '/usr/src/googletest': gmock will be built

-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")

-- Using Python nosetests: /usr/bin/nosetests3

-- catkin 0.8.10

-- BUILD_SHARED_LIBS is on

-- Could NOT find actionlib (missing: actionlib_DIR)

-- Could not find the required component 'actionlib'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):

  Could not find a package configuration file provided by "actionlib" with

  any of the following names:

    actionlibConfig.cmake

    actionlib-config.cmake

  Add the installation prefix of "actionlib" to CMAKE_PREFIX_PATH or set

  "actionlib_DIR" to a directory containing one of the above files.  If

  "actionlib" provides a separate development package or SDK, be sure it has

  been installed.

Call Stack (most recent call first):

  CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!

See also "/home/cst/catkin_ws1/src/actionlib_example_pkg/CMakeFiles/CMakeOutput.log".

See also "/home/cst/catkin_ws1/src/actionlib_example_pkg/CMakeFiles/CMakeError.log".

让我解释一下:

首先,CMake 在执行时会搜索项目所需的依赖项,以便正确配置项目。

1、在这个输出中,CMake 首先显示了正在使用的开发环境和一些配置选项,例如 Python 解释器和测试结果存储路径。

2、然后,CMake 尝试查找名为 actionlib 的软件包,但未能成功找到。

3、错误信息显示了详细信息,指出找不到 actionlib 软件包的配置文件。

可以先运行下面代码:

$ dpkg -l | grep ros-noetic-rqt-graph

$ rospack find actionlib

我的输出结果为:

cst@cst-ubuntu:~/catkin_ws1/src/actionlib_example_pkg$ rospack find actionlib

[rospack] Error: package 'actionlib' not found

cst@cst-ubuntu:~/catkin_ws1/src/actionlib_example_pkg$ apt list --installed | grep actionlib

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ros-noetic-actionlib-msgs/focal,now 1.13.1-1focal.20230620.182322 amd64 [已安装,可自动卸载]

解释一下:

第一个命令 rospack find actionlib :

        用于在 ROS 环境中查找 actionlib 软件包的安装路径。然而,它返回了一个错误,说明在您的 ROS 环境中没有找到名为 actionlib 的软件包。

第二个命令 apt list --installed | grep actionlib :

        用于在系统中查找所有已安装的软件包中是否包含名为 actionlib 的软件包。输出显示了一个名为 ros-noetic-actionlib-msgs 的软件包已经安装,并且版本号为 1.13.1-1focal.20230620.182322。这个软件包提供了 actionlib 消息的功能。

可以看出: 

        已经安装了 ros-noetic-actionlib-msgs 软件包,但未安装完整的 actionlib 软件包。

我们可以尝试使用下面的命令来安装完整的 actionlib 软件包:
 

$ sudo apt install ros-noetic-actionlib

这样就解决了actionlib软件包不完整的问题,这时候运行“cmake .”可能还会报错,

这时候重新配置你的项目就可以解决了。

  • 18
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值