码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-11-29 15:02:05      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:

在使用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

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

标签:

原文地址:http://www.cnblogs.com/luckyboylch/p/5004751.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!