2012-05-06 20 views
8

Jestem nowym użytkownikiem OpenCV i próbowałem go skonfigurować w Visual Studios 2010 Ultimate. Dokładnie podążyłem za dokumentacją i połączyłem pliki tak, jak powiedziałem. Oto dodatkowe biblioteki, z których korzystam:OpenCV nie skompiluje się z powodu nierozwiązanych czynników zewnętrznych - LNK2019

opencv_core231d.lib 
opencv_imgproc231d.lib 
opencv_highgui231d.lib 
opencv_ml231d.lib 
opencv_video231d.lib 
opencv_features2d231d.lib 
opencv_calib3d231d.lib 
opencv_objdetect231d.lib 
opencv_contrib231d.lib 
opencv_legacy231d.lib 
opencv_flann231d.lib 

I wszystkie ich odpowiedniki w wersji Release. Jednak gdy próbuję debugować & skompilować kod próbki podany mi, otrzymuję następujące błędy. (Czytałem gdzieś, że trzeba opracować i opublikować projekt, aby mogła ona działać prawidłowo? Czy to prawda, jak również?)

1>------ Build started: Project: openCVTest, Configuration: Debug Win32 ------ 
1>Build started 5/6/2012 10:39:03 AM. 
1>InitializeBuildStatus: 
1> Touching "Debug\openCVTest.unsuccessfulbuild". 
1>ClCompile: 
1> All outputs are up-to-date. 
1>ManifestResourceCompile: 
1> All outputs are up-to-date. 
1>openCVTest.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" ([email protected]@@[email protected]@[email protected]@Z) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol _cvMoveWindow referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual double __thiscall cv::VideoCapture::get(int)" ([email protected]@[email protected]@[email protected]) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" ([email protected]@@[email protected]) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::isOpened(void)const " ([email protected]@[email protected]@UBE_NXZ) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function _main 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" ([email protected]@@[email protected]) referenced in function "public: __thiscall cv::Mat::~Mat(void)" ([email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" ([email protected]@[email protected]@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" ([email protected]@[email protected]@QAEXXZ) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::Scalar_<double> __cdecl cv::sum(class cv::_InputArray const &)" ([email protected]@@[email protected]@[email protected][email protected]@@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: class cv::MatExpr __thiscall cv::Mat::mul(class cv::_InputArray const &,double)const " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function "double __cdecl getPSNR(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::convertTo(class cv::_OutputArray const &,int,double,double)const " ([email protected]@[email protected]@[email protected]@[email protected]) referenced in function "double __cdecl getPSNR(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::absdiff(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &)" ([email protected]@@[email protected]@[email protected]@@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_OutputArray::_OutputArray(class cv::Mat &)" ([email protected]@@[email protected]@[email protected]@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::Scalar_<double> __cdecl cv::mean(class cv::_InputArray const &,class cv::_InputArray const &)" ([email protected]@@[email protected]@[email protected][email protected]@[email protected]) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::_OutputArray const & __cdecl cv::noArray(void)" ([email protected]@@[email protected]@XZ) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::divide(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,double,int)" ([email protected]@@[email protected]@[email protected]@[email protected]) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator+(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator+(class cv::MatExpr const &,class cv::Scalar_<double> const &)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@Z) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator*(double,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@@Z) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::Size_<int>,double,double,int)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z) referenced in function "class cv::Scalar_<double> __cdecl getMSSIM(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@Z) referenced in function "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" ([email protected]@@[email protected]@@Z) 
1>openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::subtract(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected]) referenced in function "class cv::Mat & __cdecl cv::operator-=(class cv::Mat const &,class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@Z) 
1>C:\Users\Logan\documents\visual studio 2010\Projects\openCVTest\Debug\openCVTest.exe : fatal error LNK1120: 25 unresolved externals 
1> 
1>Build FAILED. 
1> 
1>Time Elapsed 00:00:00.40 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

przeszedłem wszystkich moich katalogów i upewnić się, że biblioteki, czy w Fakt, istnieje w moich plikach OpenCV, a moje pobieranie nie uległo uszkodzeniu lub cokolwiek. Każda pomoc będzie doceniona!

-Logantf17

+0

Muszę wiedzieć, jak dobrze wiesz, co robisz. Czy wiesz, jak połączyć się z bibliotekami? Na pierwszy rzut oka wygląda na to, że właśnie tego brakuje. – guinny

+0

1. Czy samodzielnie skompilowałeś OpenCV? 2. Czy pliki lib znajdują się pod (Właściwości -> Linker -> Wejście -> Dodatkowe zależności) w twoim projekcie wizualnym? – guinny

+0

Cóż, uczę się jak idę. Nie musiałem już wcześniej łączyć się z bibliotekami (po raz pierwszy znalazłem to potrzebne). Sprawdziłem, jak połączyć biblioteki w VS wcześniej, aby upewnić się, że robię to dobrze. Ale nie wiem, czy coś innego jest konieczne ... Takich jak pliki nagłówkowe lub inne biblioteki. – loganfarr

Odpowiedz

7

Wpadłem na ten sam problem i odkryłem, że celowałem na 32-bitową platformę. Odpowiedź polegała na zmianie mojego projektu na docelowy x64. Instrukcje znajdują się pod adresem: http://msdn.microsoft.com/en-us/library/vstudio/ms185328.aspx.

Znalazłem również wymienione powyżej referencje przez chaiy było bardzo przydatne. Tutaj znowu: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to

+0

Uratowałeś mój dzień !!!!!! ! – user2924714