• opencv编译错误记录


    找不到文件cuda_runtime.h

    在windows 11系统,opencv4.1.2+opencv_contrib+Qt5.15.2的环境下,添加了cuda的include、bin、lib的环境变量,但是仍然出现以下问题。

    In file included from E:\src\opencv_contrib-4.1.2\modules\cudaarithm\src\lut.cpp:7:
    E:\src\opencv_contrib-4.1.2\modules\cudaarithm\src\lut.hpp:10:10: fatal error: cuda_runtime.h: No such file or directory
     #include 
              ^~~~~~~~~~~~~~~~
    compilation terminated.
    
    • 1
    • 2
    • 3
    • 4
    • 5

    解决:
    找到cuda_runtime.h的绝对路径,把此处的#include 改成#include

    找不到boostdesc_bgm.i

    E:\src\opencv_contrib-4.1.2\modules\xfeatures2d\src\boostdesc.cpp:654:20: fatal error: boostdesc_bgm.i: No such file or directory
               #include "boostdesc_bgm.i"
                        ^~~~~~~~~~~~~~~~~
    compilation terminated.
    
    • 1
    • 2
    • 3
    • 4

    解决:下载这个文件,解压到这个目录opencv_contrib/modules/xfeatures2d/src/

    找不到features2d/test/test_detectors_regression.impl.hpp

    E:\src\opencv_contrib-4.1.2\modules\xfeatures2d\test\test_features2d.cpp:51:10: fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory
     #include "features2d/test/test_detectors_regression.impl.hpp"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    mingw32-make[2]: *** [modules\
    
    • 1
    • 2
    • 3
    • 4
    • 5

    解决:将opencv / modules / features2d复制,然后粘贴到build目录中来解决该问题。

    找不到namespace cv::cuda::device::blend;

    E:\src\opencv-4.1.2\modules\stitching\src\blenders.cpp: In member function 'virtual void cv::detail::MultiBandBlender::feed(cv::InputArray, cv::InputArray, cv::Point)':
    E:\src\opencv-4.1.2\modules\stitching\src\blenders.cpp:470:39: error: 'cv::cuda::device' has not been declared
                 using namespace cv::cuda::device::blend;
    
    • 1
    • 2
    • 3

    去掉BUILD_CUDA_SYUBS和OPENCV_DNN_CUDA

  • 相关阅读:
    等保三级安全要求简要攻略-安全物理环境
    一文揭秘育碧等传统游戏大厂的NFT策略
    桥接模式(Bridge Pattern)
    JAVA 集合
    建造者模式(装修公司装修套餐)
    浅谈redis分布式锁
    Day09 React———— 第九天
    AS/400连接字符串
    cppcheck 代码静态扫描
    【BSP开发之kernel】Linux启动流程以及编译流程分析
  • 原文地址:https://blog.csdn.net/u013456468/article/details/127658833