title: error LNK2019: unsolvable external symbol (OpenCV + VS2012)
body: <p>I've searched a lot but none of the answers help.</p>
  
  <p>I added these things below:</p>
  
  <pre><code>include directory: D:\Program Files (x86)\opencv\build\include
  library directory: D:\Program Files (x86)\opencv\build\x86\vc11\lib
  additional library directory: D:\Program Files (x86)\opencv\build\x86\vc11\lib
  additional dependency: %(AdditionalDependencies);opencv_core248d.lib;opencv_imgproc248d.lib;opencv_ml248d.lib;opencv_video248d.lib;opencv_features2d248d.lib;opencv_calib3d248d.lib;opencv_objdetect248d.lib;opencv_contrib248d.lib;opencv_legacy248d.lib;opencv_flann248d.lib;
  </code></pre>
  
  <p>I'm using 64-bit machine but adding x64 directory cause a lot of trouble, so I add x86 directory instead.</p>
  
  <p>I used the test code below:</p>
  
  <pre><code>#include "opencv2/opencv.hpp"
  
  using namespace cv;  
  int main()  
  {  
      Mat img = imread("../opencv.jpg");  
  
      if (img.empty())  
      {  
          fprintf(stderr, "Error: load image failed.");  
          return -1;  
      }  
      namedWindow("image", CV_WINDOW_AUTOSIZE);  
      imshow("image", img);  
      waitKey();  
  
      return 0;  
  }  
  </code></pre>
  
  <p>And the problem is: (ignore the Chinese part)</p>
  
  <pre><code>1&gt;test.obj : error LNK2019: unsolvable external symbol "void __cdecl cv::namedWindow(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,int)" (?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)，该符号在函数 _main 中被引用
  1&gt;test.obj : error LNK2019: unsolvable external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z)，该符号在函数 _main 中被引用
  1&gt;test.obj : error LNK2019: unsolvable external symbol "void __cdecl cv::imshow(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class cv::_InputArray const &amp;)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z)，该符号在函数 _main 中被引用
  1&gt;test.obj : error LNK2019: unsolvable external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,int)" (?imread@cv@@YA?AVMat@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)，该符号在函数 _main 中被引用
  </code></pre>
  
  <p>Thank you in advance!!</p>