Reputation: 35
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?
Upvotes: 1
Views: 7229
Reputation: 2712
Try to include opencv_objdetect220d.lib too. It worked like a charm.
Upvotes: 5
Reputation: 1028
Have you added the libraries to your link dependencies?
right-click on your project -> Properties -> Linker -> Input -> Additional Dependencies
Upvotes: 3