• 由lib引发的血案(opencv找不函数问题)


    在使用opencv中的函数时,连续两次遇到函数找不到的问题,第一次查时按照他人说的包含进一个头文件后,果真还真解决了;然而第二次在调用cvInpaint函数时包含进对应头文件,编译通过但运行不成功还是未定义标识符。在网上搜了之后才真正理解了原因,某个函数找不到主要是由于debug和release库文件没有选择完全.

    解决办法:
    先加入debug和release缺少的库文件后,然后再include进包含该函数声明的头文件即可调用.
    eg:cvInpaint找不到。

    在配置属性的时候,在连接器->输入 附加依关系 中加入库文件opencv_photo2411d.lib后,再#include "opencv2/photo/photo_c.h"即可使用cvInpaint

    opencv官方配置一般都会缺少一些库文件,以下是以opencv2.4.3为例对库的一些补充。

    配置DEBUG(以2.4.3为例):
    opencv_calib3d243d.lib
    opencv_contrib243d.lib
    opencv_core243d.lib
    opencv_features2d243d.lib
    opencv_flann243d.lib
    opencv_gpu243d.lib
    opencv_highgui243d.lib
    opencv_imgproc243d.lib
    opencv_legacy243d.lib
    opencv_ml243d.lib
    opencv_objdetect243d.lib
    opencv_ts243d.lib
    opencv_video243d.lib

    //补充DEBUG库

    opencv_haartraining_engined.lib
    opencv_nonfree243d.lib
    opencv_photo243d.lib
    opencv_stitching243d.lib
    opencv_videostab243d.lib

    配置 RELEASE:
    opencv_calib3d243.lib
    opencv_contrib243.lib
    opencv_core243.lib
    opencv_features2d243.lib
    opencv_flann243.lib
    opencv_gpu243.lib
    opencv_highgui243.lib
    opencv_imgproc243.lib
    opencv_legacy243.lib
    opencv_ml243.lib
    opencv_objdetect243.lib
    opencv_ts243.lib
    opencv_video243.lib

    //补充RELEASE库文件

    opencv_haartraining_engine.lib
    opencv_nonfree243.lib
    opencv_photo243.lib
    opencv_stitching243.lib
    opencv_videostab243.lib

  • 相关阅读:
    0001_two_sum
    shell 命令
    先验概率,后验概率,似然函数,最大似然估计【待整理】
    numpy学习笔记
    python: __slots__ 解析 (待整理)
    ubuntu,win7双系统问题
    安装sogou输入法
    pytorch安装
    稀疏向量的一些内容
    extern c
  • 原文地址:https://www.cnblogs.com/luckyboylch/p/5004751.html
Copyright © 2020-2023  润新知