문제

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

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

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

Relevant code lines:

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.

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

다른 팁

Try to include opencv_objdetect220d.lib too. It worked like a charm.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top