title: Flann functions unresolved externals
body: <p>I'm trying to run one of the tutorial examples from OpenCV. It is about finding a known object with use of Flann based key point matching. Code can be found on <a href="http://opencv.itseez.com/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography">Features2D + Homography to find a known object</a>.</p>
  
  <p>I know you will ask "Did you link the libraries?" or similar question. Yes I have been using OpenCV for 3 weeks with various examples which make use of nearly all libraries. And there was no problem until this day. </p>
  
  <p>So I added these library dependecies to Visual Studio's linker input settings. Include directories are also working fine.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The error I got is a linker error. It can't resolve Flann's functions.</p>
  
  <pre><code>1&gt;------ Build started: Project: flannMatch, Configuration: Debug Win32 ------
  1&gt;flannMatch.obj : error LNK2019: unresolved external symbol "void __cdecl cv::drawMatches(class cv::Mat const &amp;,class std::vector&lt;class cv::KeyPoint,class std::allocator&lt;class cv::KeyPoint&gt; &gt; const &amp;,class cv::Mat const &amp;,class std::vector&lt;class cv::KeyPoint,class std::allocator&lt;class cv::KeyPoint&gt; &gt; const &amp;,class std::vector&lt;struct cv::DMatch,class std::allocator&lt;struct cv::DMatch&gt; &gt; const &amp;,class cv::Mat &amp;,class cv::Scalar_&lt;double&gt; const &amp;,class cv::Scalar_&lt;double&gt; const &amp;,class std::vector&lt;char,class std::allocator&lt;char&gt; &gt; const &amp;,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&gt;flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorMatcher::match(class cv::Mat const &amp;,class cv::Mat const &amp;,class std::vector&lt;struct cv::DMatch,class std::allocator&lt;struct cv::DMatch&gt; &gt; &amp;,class cv::Mat const &amp;)const " (?match@DescriptorMatcher@cv@@QBEXABVMat@2@0AAV?$vector@UDMatch@cv@@V?$allocator@UDMatch@cv@@@std@@@std@@0@Z) referenced in function_main
  1&gt;flannMatch.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::FlannBasedMatcher::FlannBasedMatcher(class cv::Ptr&lt;struct cv::flann::IndexParams&gt; const &amp;,class cv::Ptr&lt;struct cv::flann::SearchParams&gt; const &amp;)" (??0FlannBasedMatcher@cv@@QAE@ABV?$Ptr@UIndexParams@flann@cv@@@1@ABV?$Ptr@USearchParams@flann@cv@@@1@@Z) referenced in function _main
  1&gt;flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::DescriptorExtractor::compute(class cv::Mat const &amp;,class std::vector&lt;class cv::KeyPoint,class std::allocator&lt;class cv::KeyPoint&gt; &gt; &amp;,class cv::Mat &amp;)const " (?compute@DescriptorExtractor@cv@@QBEXABVMat@2@AAV?$vector@VKeyPoint@cv@@V?$allocator@VKeyPoint@cv@@@std@@@std@@AAV32@@Z) referenced in function _main
  1&gt;flannMatch.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::FeatureDetector::detect(class cv::Mat const &amp;,class std::vector&lt;class cv::KeyPoint,class std::allocator&lt;class cv::KeyPoint&gt; &gt; &amp;,class cv::Mat const &amp;)const " (?detect@FeatureDetector@cv@@QBEXABVMat@2@AAV?$vector@VKeyPoint@cv@@V?$allocator@VKeyPoint@cv@@@std@@@std@@0@Z) referenced in function _main
  1&gt;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&gt;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&gt;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&gt;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)
  </code></pre>
  
  <p>I also know that surf and sift was moved to nonfree, thanks to one of questions here. At first glance I thought it may be because I have two version of OpenCV (2.2 and 2.4) and thus it was making a difference. So I removed 2.2 and tried to run another program. It was working fine but still this error was not gone.</p>
  
  <p>So my question, what am I missing here? Is there another library dependency? What is it that I can't see? Any help is appreciated.</p>
  
  <p>--<strong>EDIT</strong>--</p>
  
  <p>How could I not see it? I'm really sorry for posting an easy question like this. I feel so stupid. I had forgotten to add this dependency. </p>
  
  <pre><code>C:\OpenCV2.4\lib\opencv_features2d242d.lib
  </code></pre>
  
  <p>I dont think anybody would miss that again.</p>