Flann performs unauthorized external

I am trying to run one of the examples from OpenCV. It is about finding a well-known object using key points matching based on Flann. The code can be found on Features2D + Homography to find a known object .

I know what you ask: "Did you link libraries?" or similar question. Yes, I have been using OpenCV for 3 weeks with various examples that almost all libraries use. And until that day there were no problems.

So, I added these libraries depending on the login settings in the Visual Studio linker. Include directories also work great.

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 

The error I received is a linker error. He cannot enable Flann functions.

 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)" ( ?drawMatches@cv @@ YAXABVMat@1 @ ABV?$vector@VKeyPoint @ cv@ @ V?$allocator@VKeyPoint @ cv@ @@ std@ @@ std@ @ 01ABV?$vector@UDMatch @ cv@ @ V?$allocator@UDMatch @ cv@ @@ std@ @@ 4@AAV21 @ ABV?$Scalar_@N @ 1@4ABV ?$vector@DV ?$allocator@D @ std@ @@ 4@H @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 " ( ?match@DescriptorMatcher @ cv@ @ QBEXABVMat@2 @ 0AAV?$vector@UDMatch @ cv@ @ V?$allocator@UDMatch @ cv@ @@ std@ @@ std@ @ 0@Z ) 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 &)" ( ??0FlannBasedMatcher@cv @@ QAE@ABV ?$Ptr@UIndexParams @ flann@cv @@@ 1@ABV ?$Ptr@USearchParams @ flann@cv @@@ 1@ @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 " ( ?compute@Descri ptorExtractor@cv @@ QBEXABVMat@2 @ AAV?$vector@VKeyPoint @ cv@ @ V?$allocator@VKeyPoint @ cv@ @@ std@ @@ std@ @ AAV32@ @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 " ( ?detect@FeatureDetector @ cv@ @ QBEXABVMat@2 @ AAV?$vector@VKeyPoint @ cv@ @ V?$allocator@VKeyPoint @ cv@ @@ std@ @@ std@ @ 0@Z ) referenced in function _main 1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::~DescriptorMatcher(void)" ( ??1DescriptorMatcher@cv @@ UAE@XZ ) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ( ??1FlannBasedMatcher@cv @@ UAE@XZ ) 1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection(void)" ( ??1DescriptorCollection@DescriptorMatcher @ cv@ @ UAE@XZ ) referenced in function "public: virtual __thiscall cv::FlannBasedMatcher::~FlannBasedMatcher(void)" ( ??1FlannBasedMatcher@cv @@ UAE@XZ ) 1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::FeatureDetector::~FeatureDetector(void)" ( ??1FeatureDetector@cv @@ UAE@XZ ) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ( ??1Feature2D@cv @@ UAE@XZ ) 1>flannMatch.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::DescriptorExtractor::~DescriptorExtractor(void)" ( ??1DescriptorExtractor@cv @@ UAE@XZ ) referenced in function "public: virtual __thiscall cv::Feature2D::~Feature2D(void)" ( ??1Feature2D@cv @@ UAE@XZ ) 

I also know that surfing and screening have been moved to non-free, one of the issues here. At first glance, I thought that this could be because I have two versions of OpenCV (2.2 and 2.4), and therefore it matters. So I uninstalled 2.2 and tried to run another program. It worked fine, but this error did not disappear.

So my question is, what am I missing here? Is there any other dependency on the library? What I do not see? Any help is appreciated.

- CHANGE -

How could I not see him? I'm sorry that you asked a simple question. I'm so stupid. I forgot to add this dependency.

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

I donโ€™t think anyone will miss this again.

+7
source share
1 answer

How could I not see him? I am very sorry that you posted a simple question. I'm so stupid. I forgot to add this dependency.

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

I donโ€™t think anyone will miss this again.

+2
source

All Articles