Could NOT find cv_bridge (missing: cv_bridge_DIR)

catkin_make:build报错信息显示如下:

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - line_det
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'line_det'
-- ==> add_subdirectory(line_det)
-- Could NOT find cv_bridge (missing: cv_bridge_DIR)
-- Could not find the required component 'cv_bridge'. 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/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "cv_bridge" with
  any of the following names:

    cv_bridgeConfig.cmake
    cv_bridge-config.cmake

  Add the installation prefix of "cv_bridge" to CMAKE_PREFIX_PATH or set
  "cv_bridge_DIR" to a directory containing one of the above files.  If
  "cv_bridge" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  line_det/CMakeLists.txt:9 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/dzh/Demo/lineDet/build/CMakeFiles/CMakeOutput.log".
See also "/home/dzh/Demo/lineDet/build/CMakeFiles/CMakeError.log".
Makefile:852: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
终端进程“/bin/bash '-c', 'catkin_make'”已终止,退出代码: 1

由于安装ROS时没有安装它的opencv模块,导致没有cv_bridge库,输入命令安装即可:

sudo apt-get install ros-melodic-cv-bridge

然后会显示即将安装的软件列表,确认无误后输入y回车进行安装。

将会同时安装下列软件:
  liblept5 libopencv-calib3d-dev libopencv-contrib-dev libopencv-contrib3.2
  libopencv-dev libopencv-features2d-dev libopencv-highgui-dev
  libopencv-objdetect-dev libopencv-stitching-dev libopencv-videostab-dev
  libopencv3.2-java libopencv3.2-jni libtesseract4 python-opencv
建议安装:
  opencv-doc
下列【新】软件包将被安装:
  liblept5 libopencv-calib3d-dev libopencv-contrib-dev libopencv-contrib3.2
  libopencv-dev libopencv-features2d-dev libopencv-highgui-dev
  libopencv-objdetect-dev libopencv-stitching-dev libopencv-videostab-dev
  libopencv3.2-java libopencv3.2-jni libtesseract4 python-opencv
  ros-melodic-cv-bridge
升级了 0 个软件包,新安装了 15 个软件包,要卸载 0 个软件包,有 417 个软件包未被升级。
需要下载 8,128 kB 的归档。
解压缩后会消耗 36.8 MB 的额外空间。
您希望继续执行吗? [Y/n] y

再次catkin_make:build发现程序运行成功。

在这里插入代码片`-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - line_det
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'line_det'
-- ==> add_subdirectory(line_det)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- line_det: 1 messages, 0 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dzh/Demo/lineDet/build
####
#### Running command: "make -j12 -l12" in "/home/dzh/Demo/lineDet/build"
####
Scanning dependencies of target line_det
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_nodejs
[ 11%] Building CXX object line_det/CMakeFiles/line_det.dir/src/line_det.cpp.o
[ 11%] Built target _line_det_generate_messages_check_deps_Point
[ 22%] Built target line_det_generate_messages_lisp
[ 33%] Built target line_det_generate_messages_nodejs
[ 55%] Built target line_det_generate_messages_eus
[ 66%] Built target line_det_generate_messages_cpp
[ 88%] Built target line_det_generate_messages_py
[ 88%] Built target line_det_generate_messages
In file included from /opt/ros/melodic/include/ros/publisher.h:35:0,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/dzh/Demo/lineDet/src/line_det/src/line_det.cpp:1:
/usr/local/include/boost/bind.hpp:41:1: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
 )
 ^
[100%] Linking CXX executable /home/dzh/Demo/lineDet/devel/lib/line_det/line_det`
  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

振华OPPO

你的鼓励是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值