带有objdetect.hpp函数的OpenCV无法解决的外部错误(C ++) [英] OpenCV unresolved external errors with objdetect.hpp functions (C++)

查看:197
本文介绍了带有objdetect.hpp函数的OpenCV无法解决的外部错误(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VS2010中用C ++编译一个简单的人脸检测程序,并且遇到了两个LNK 2019错误:

I'm trying to compile a simple face detection program in C++ in VS2010 and have come across two LNK 2019 errors:

错误2错误LNK2019:函数_main中引用的未解析的外部符号_cvReleaseHaarClassifierCascade

Error 2 error LNK2019: unresolved external symbol _cvReleaseHaarClassifierCascade referenced in function _main

错误3错误LNK2019:在函数"void __cdecl detectFaces(struct _IplImage *)"中引用的未解析的外部符号_cvHaarDetectObjects(?detectFaces @@ YAXPAU_IplImage @@@ Z)

Error 3 error LNK2019: unresolved external symbol _cvHaarDetectObjects referenced in function "void __cdecl detectFaces(struct _IplImage *)" (?detectFaces@@YAXPAU_IplImage@@@Z)

相关代码行:

cvReleaseHaarClassifierCascade( &cascade );

...

  CvSeq *faces = cvHaarDetectObjects(  img,  cascade,  storage,  1.1,  3,  0, /*CV_HAAR_DO_CANNY_PRUNNING*/  cvSize( 40, 40 ) );

我真的找不到很多关于此特定问题的参考,我相信所有相关的库/目录都应按解决方案的原样放置.

I couldn't really find many references to this particular issue and I believe all the relevant libraries/directories are as they should be for the solution.

当我转到函数定义时,会在objdetect.hpp中找到它们,但是我不明白为什么我会遇到这些LNK错误?

When I go to the function definitions it finds them in objdetect.hpp but what I don't understand is why I'm getting these LNK errors?

推荐答案

您是否已将库添加到链接依赖项中?

Have you added the libraries to your link dependencies?

右键单击您的项目->属性->链接器->输入->其他依赖项

right-click on your project -> Properties -> Linker -> Input -> Additional Dependencies

这篇关于带有objdetect.hpp函数的OpenCV无法解决的外部错误(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆