2012-08-28 11 views
7

Ich versuche, eines der Tutorial-Beispiele von OpenCV auszuführen. Es geht darum, ein bekanntes Objekt unter Verwendung eines Flann-basierten Schlüsselpunktabgleichs zu finden. Code kann auf Features2D + Homography to find a known object gefunden werden.Flann Funktionen nicht aufgelöste externe

Ich weiß, dass Sie fragen werden "Haben Sie die Bibliotheken verlinkt?" oder ähnliche Frage. Ja, ich verwende OpenCV seit 3 ​​Wochen mit verschiedenen Beispielen, die fast alle Bibliotheken nutzen. Und bis zu diesem Tag gab es kein Problem.

Also habe ich diese Bibliothek Abhängigkeiten zu Visual Studio Linker-Eingabe-Einstellungen hinzugefügt. Include-Verzeichnisse funktionieren auch gut.

C:\OpenCV2.4\lib\opencv_core242d.lib 
C:\OpenCV2.4\lib\opencv_highgui242d.lib 
C:\OpenCV2.4\lib\opencv_video242d.lib 
C:\OpenCV2.4\lib\opencv_ml242d.lib 
C:\OpenCV2.4\lib\opencv_legacy242d.lib 
C:\OpenCV2.4\lib\opencv_imgproc242d.lib 
C:\OpenCV2.4\lib\opencv_objdetect242d.lib 
C:\OpenCV2.4\lib\opencv_flann242d.lib 
C:\OpenCV2.4\lib\opencv_nonfree242d.lib 
C:\OpenCV2.4\lib\opencv_calib3d242d.lib 

Der Fehler Ich habe ein Linker Fehler. Es kann Flanns Funktionen nicht auflösen.

1>------ Build started: Project: flannMatch, Configuration: Debug Win32 ------ 
1>flannMatch.obj : error LNK2019: unresolved external symbol "void __cdecl cv::drawMatches(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > const &,class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > const &,class std::vector<struct cv::DMatch,class std::allocator<struct cv::DMatch> > const &,class cv::Mat &,class cv::Scalar_<double> const &,class cv::Scalar_<double> const &,class std::vector<char,class std::allocator<char> > const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorMatcher::match(class cv::Mat const &,class cv::Mat const &,class std::vector<struct cv::DMatch,class std::allocator<struct cv::DMatch> > &,class cv::Mat const &)const " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]) referenced in function_main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::FlannBasedMatcher::FlannBasedMatcher(class cv::Ptr<struct cv::flann::IndexParams> const &,class cv::Ptr<struct cv::flann::SearchParams> const &)" ([email protected]@@[email protected][email protected]@[email protected]@@@[email protected][email protected]@[email protected]@@@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorExtractor::compute(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &,class cv::Mat &)const " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]@Z) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::FeatureDetector::detect(class cv::Mat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &,class cv::Mat const &)const " ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@[email protected]@[email protected]) referenced in function _main 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::~DescriptorMatcher(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection(void)" ([email protected]@[email protected]@[email protected]) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ([email protected]@@[email protected]) 
1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorExtractor::~DescriptorExtractor(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ([email protected]@@[email protected]) 

Ich weiß auch, dass Surfen und sichten wurde unfreie bewegt, dank einer von Fragen. Auf den ersten Blick dachte ich, das könnte daran liegen, dass ich zwei Versionen von OpenCV (2.2 und 2.4) habe und damit einen Unterschied machte. Also habe ich 2.2 entfernt und versucht, ein anderes Programm zu starten. Es hat gut funktioniert, aber dieser Fehler ist nicht verschwunden.

Also meine Frage, was fehlt mir hier? Gibt es eine andere Bibliotheksabhängigkeit? Was kann ich nicht sehen? Jede Hilfe wird geschätzt.

- EDIT -

Wie kann ich es nicht sehen? Es tut mir wirklich leid, eine einfache Frage wie diese gestellt zu haben. Ich fühle mich so dumm. Ich hatte vergessen, diese Abhängigkeit hinzuzufügen.

C:\OpenCV2.4\lib\opencv_features2d242d.lib 

Ich glaube nicht, dass jemand das wieder verpassen würde.

+0

Sie sind nicht die erste oder die letzte Person, die die Antwort kurz nach der Veröffentlichung der Frage finden :). Danke, dass Sie die Antwort mit uns geteilt haben. – bjoernz

+0

Eine Antwort sollte jedoch als * Antwort * geteilt werden, nicht als Teil der Frage. –

+0

Ich weiß, aber wegen des Rufs kann ich meine Fragen nicht beantworten, bis 8 Stunden vergangen sind. Noch 6 Stunden zu gehen: D – yutasrobot

Antwort

2

Wie könnte ich es nicht sehen? Es tut mir wirklich leid, eine einfache Frage wie diese gestellt zu haben. Ich fühle mich so dumm. Ich hatte vergessen, diese Abhängigkeit hinzuzufügen.

C:\OpenCV2.4\lib\opencv_features2d242d.lib 

Ich glaube nicht, dass jemand das wieder verpassen würde.

Verwandte Themen