在用cmake编译时,遇到opencv报错runtime library

这篇具有很好参考价值的文章主要介绍了在用cmake编译时,遇到opencv报错runtime library。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

错误描述

CMake Warning at CMakeLists.txt:123 (add_executable):
  Cannot generate a safe runtime search path for target mono_euroc because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libopencv_stitching.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_aruco.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_bgsegm.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_bioinspired.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_ccalib.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_dnn_objdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_dnn_superres.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_dpm.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_highgui.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_face.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_freetype.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_fuzzy.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_hdf.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_hfs.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_img_hash.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_line_descriptor.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_quality.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_reg.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_rgbd.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_saliency.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_shape.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_stereo.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_structured_light.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_phase_unwrapping.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_superres.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_optflow.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_surface_matching.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_tracking.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_datasets.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_plot.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_text.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_dnn.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_ml.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_videostab.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_videoio.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_viz.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_ximgproc.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_video.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_xobjdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_imgcodecs.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_objdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_calib3d.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_features2d.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_flann.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_xphoto.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_photo.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_imgproc.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib
    runtime library [libopencv_core.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/lib

  Some of these libraries may not be found correctly.

解决方法

SET(OpenCV_DIR /usr/local/lib/cmake/opencv4/)   # 设置OpenCV_DIR
SET(OpenCV_DIR /usr/local/lib/cmake/opencv4/)   # 设置OpenCV_DIR
find_package(OpenCV QUIET)
if(NOT OpenCV_FOUND)
   find_package(OpenCV 2.4.3 QUIET)
   if(NOT OpenCV_FOUND)
      message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
   endif()
endif()

# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS "    config: ${OpenCV_DIR}")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")

文章来源地址https://www.toymoban.com/news/detail-800671.html

到了这里,关于在用cmake编译时,遇到opencv报错runtime library的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • (不用手动下文件)opencv用CMake编译下载失败解决

    报错信息: 解决思路: 更改cmake文件,使用GitHub Proxy 代理加速 (ghproxy.com)对网址进行转发。、 解决步骤: ① 打开opencv-4.7.0cmakeOpenCVDownload.cmake,在157行下方增加两行: (opencv-4.7.0为 源码文件夹 ,不同版本的名称会不一样,如opencv-4.6.0等等) ② 修改完如下图所示(修改完

    2024年02月03日
    浏览(38)
  • 编译opencv环境搭建:vs2019 + cmake-3.25 + opencv-4.5.5

    一 下载vs2019 链接:Downloads - Visual Studio Subscriptions Portal 下载社区版本,因为是免费的,大家随便用 下载成功后直接安装就可以了。 有的环境安装好后在属性管理器中可能没有 Microsoft.Cpp.x64 文件 从如下链接下载 Microsoft.Cpp.x64 文件  (链接转载(227条消息) 解决vs2019属性管理器里

    2024年02月11日
    浏览(56)
  • 使用cmake编译opencv过程中的可选参数说明

    opencv版本:4.5.5 通过源码编译opencv时,cmake可以带有很多可选参数,这里对这些可选参数进行说明。 配置选项可以通过几种不同的方式设置: 命令行:cmake-Doption=value… 初始缓存文件:cmake-C my_options.txt… 通过Cmake-GUI进行设定 在本参考中,我们将使用常规命令行。 最常用和有

    2024年02月16日
    浏览(49)
  • OpenCV使用CMake和MinGW-w64的编译安装

    OpenCV使用CMake和MinGW-w64的编译安装中的问题 问题:gcc: error: long: No such file or directory** C:PROGRA~2Dev-CppMinGW64binwindres.exe: preprocessing failed. modulescoreCMakeFilesopencv_core.dirbuild.make:1420: recipe for target ‘modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj’ failed mingw32-make[2]: *** [modules/core/

    2024年02月10日
    浏览(63)
  • CMAKE编译 opencv、opencv_contrib出现ADE无法下载解决方案

    问题: CMake Error at xxxx/DownlodeADE.cmake:23(add_library): 解决方案:你的opencv的安装路径下,(我的路径就是opencv4.5.4/modules/gapi/cmke/ )找到如下图片,打开DownloadADE.cmake文件 文件中有github网址,需要去文件中提供的网址下载文件,我的opencv版本是4.5.4,有需要可以滴滴。 第一行是你

    2024年02月22日
    浏览(60)
  • 【gcc, cmake, eigen, opencv,ubuntu】二.gcc编译选项

    1.-march=native 其中-march选项就是就是指定目标架构的名字,gcc就会生成针对目标架构优化的目标代码,如-march=prescott会生成针对i5或i7的目标码,从而充分发挥cpu的性能。自gcc4.2,引入了-march=native,从而允许编译器自动探测目标架构并生成针对目标架构优化的目标代码,这比手

    2024年02月09日
    浏览(44)
  • Windows环境利用QT+CMake编译mingw版本的opencv

    Opencv官网没有提供mingw版本的opencv库,所以需要自己编译,下面是编译过程,32位64位方法类似。 可以直接下载编译好的mingw版本opencv4.4: 使用CMAKE3.22+QT5.13编译后的opencv4.4(32位的)资源-CSDN文库 如果网络不好,可能会需要自己手动下载下面的文件:  opencv_videoio_ffmpeg.dll+ope

    2024年02月13日
    浏览(52)
  • OpenCV4.6.0及其扩展模块OpenCV_contrib的Cmake编译安装指南

    下载地址 注意: 从github上下载时尽量避免使用zip下载方式,可能丢失文件。可使用git在网络状况良好(梯纸)时进行下载。 下载地址 选择zip压缩包下载并解压即可。 OpenCV源码版本 必须 与扩展模块版本一致!!! 打开 Cmake ,选择OpenCV源码路径 新建一个build文件夹,编译后

    2024年02月13日
    浏览(67)
  • opencv4.7.0 win10 源码编译 vs2019 cmake

    步骤: ① 编译opencv源码;注意几个下载内容;根据cmakedownloadlog.txt中的说明 ② 生成opencv.sln,先使用ALL_BUILD生成 ③ 然后对install工程进行生成 ④ 使用:离线使用,opencv文件夹 install的include lib bin 等复制到当前工程下的文件夹;然后配置属性     配置属性时注意一下路径,工

    2024年02月04日
    浏览(68)
  • C/C++开发,linux下OpenCV+gcc+cmake编译环境搭建

    目录 一、源码下载 二、源码编译         2.1 OpenCV源码下载         2.2 cmake安装(非必要)         2.3 opencv安装依赖及支持模块查看         2.4 安装pkgconfig包         2.5 安装opencv依赖包         2.6 真正安装opencv包开始         2.7 opencv环境路径配置 三、案

    2024年02月06日
    浏览(53)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包