OpenCV 243 using static error libs LNK2019

I am trying to use openCV243 static libraries in a 64bit vs10 console application. My OS is win7 64 bit.

I have included the following libraries:

#pragma comment(lib,"../final_test/libs/staticlib/opencv_core243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_highgui243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_imgproc243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_video243d.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_flann243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_features2d243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_objdetect243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_core243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_calib3d243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_legacy243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_features2d243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_ml243.lib") #pragma comment(lib,"../final_test/libs/staticlib/libjpeg.lib") #pragma comment(lib,"../final_test/libs/staticlib/libpng.lib") #pragma comment(lib,"../final_test/libs/staticlib/libtiff.lib") #pragma comment(lib,"../final_test/libs/staticlib/libjasper.lib") #pragma comment(lib,"../final_test/libs/staticlib/zlib.lib") #pragma comment(lib,"../final_test/libs/staticlib/IlmImf.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_videostab243") #pragma comment(lib,"../final_test/libs/staticlib/opencv_contrib243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_nonfree243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_photo243.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_stitching243.lib") #pragma comment(lib,"../final_test/libs/staticlib/IlmImf.lib") #pragma comment(lib,"../final_test/libs/staticlib/opencv_ts243.lib") 

Runtime Library: Multithreaded (/ MT)

I get the following binding errors.

 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIFileInit referenced in function "void __cdecl icvInitCapture_VFW(void)" ( ?icvInitCapture_VFW@ @YAXXZ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIStreamGetFrameOpen referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::open(char const *)" ( ?open@CvCaptureAVI _VFW@ @ UEAA_NPEBD@Z ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIStreamInfoA referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::open(char const *)" ( ?open@CvCaptureAVI _VFW@ @ UEAA_NPEBD@Z ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIFileGetStream referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::open(char const *)" ( ?open@CvCaptureAVI _VFW@ @ UEAA_NPEBD@Z ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIFileOpenA referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::open(char const *)" ( ?open@CvCaptureAVI _VFW@ @ UEAA_NPEBD@Z ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIStreamGetFrame referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::grabFrame(void)" ( ?grabFrame@CvCaptureAVI _VFW@ @UEAA_NXZ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol ICClose referenced in function "protected: void __cdecl CvCaptureCAM_VFW::closeHIC(void)" ( ?closeHIC@CvCaptureCAM _VFW@ @IEAAXXZ) 1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol ICSendMessage referenced in function "protected: void __cdecl CvCaptureCAM_VFW::closeHIC(void)" ( ?closeHIC@CvCaptureCAM _VFW@ @IEAAXXZ) 

...

Can someone help me get rid of this problem? Thanks.

+7
source share
2 answers

You need to link to the MS vfw32.lib library.

+13
source

just do it in ur header file. It should work fine.

 #include "opencv2/opencv.hpp" #pragma comment(lib, "vfw32.lib") #pragma comment( lib, "comctl32.lib" ) 
+5
source

All Articles