2012-11-20 6 views
7

Ich versuche, openCV243 statische libs in 64bit vs10 Konsolenanwendung zu verwenden. Mein Betriebssystem ist Win7 64 Bit.openCV 243 mit statischen libs Fehler LNK2019

Ich habe enthalten folgende Libs:

#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") 

Die Laufzeitbibliothek ist: Multi-Threaded (/ MT)

ich Verknüpfungsfehler erhalten folgen.

1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIFileInit referenced in function "void __cdecl icvInitCapture_VFW(void)" ([email protected]@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 *)" ([email protected][email protected]@[email protected]) 
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 *)" ([email protected][email protected]@[email protected]) 
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 *)" ([email protected][email protected]@[email protected]) 
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 *)" ([email protected][email protected]@[email protected]) 
1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol AVIStreamGetFrame referenced in function "public: virtual bool __cdecl CvCaptureAVI_VFW::grabFrame(void)" ([email protected][email protected]@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)" ([email protected][email protected]@IEAAXXZ) 
1>opencv_highgui243.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol ICSendMessage referenced in function "protected: void __cdecl CvCaptureCAM_VFW::closeHIC(void)" ([email protected][email protected]@IEAAXXZ) 

...

kann mir jemand helfen, dieses Problem zu beheben? Vielen Dank.

+0

Kompiliert es, wenn Sie die "highgui" -Bi nicht einschließen? – Niko

+0

Das könnte auch helfen: http://stackoverflow.com/questions/849238/how-cani-i-resolve-error-lnk2019-unresolved-external-symbol – Niko

+0

Vielen Dank für Ihre Kommentare. Leider, ohne highgui kompiliert das Projekt nicht. – user1043413

Antwort

13

Sie müssen mit MS vfw32.lib Bibliothek verknüpfen.

+2

auch comctl32.lib wird benötigt –

+0

kann ich mehr Hilfe bekommen, wie das gemacht wird? –

+0

@ChaiNadig fügen Sie entweder pragmas wie in der Antwort von furqan oder in VC++ 2010 Express hinzu: Projekteigenschaften (Alt-F7) -> Konfigurationseigenschaften -> Linker -> Eingabe; Klicken Sie im Dropdown-Menü auf den Wert Zusätzliche Abhängigkeiten, < Bearbeiten ... >, fügen Sie eine Liste der Bibliotheksdateien oben ein. Sie werden vfw32.lib und comctl32.lib in separaten Zeilen und libs von% OPENCV_DIR% \ build \ x86 \ vc10 \ staticlib ebenfalls haben. – sastanin

5

tun Sie dies in Ihrer Header-Datei. Es sollte perfekt funktionieren.

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

Funktioniert das auch für 64 Bit? – tzippy

+0

Ja, warum nicht, es sollte funktionieren. – furqan

+0

Also gibt es keine 64-Bit-Version, die ich lieber verlinken sollte? Oder sind diese Dateien automatisch 64bit in meinem System32 Ordner? Ich habe ein 64bit Windows 7. Das Problem, das ich habe, ist, dass, seit ich in 64bit kompiliert, die 'cv: VideoCapture :: readMat (CV_OUT Mat & Bild)' eine leere 'cv :: Mat' zurückgibt – tzippy