title: OpenCv unresolved external symbol error in Visual Studio
body: <p>I have linked to the libraries I want to use and added the header files to my project. And the code doesn't show any errors in red squiggle but when I try to run it, it gives me the following error:</p>
  
  <pre><code>Error   1   error LNK2001: unresolved external symbol _cvDestroyWindow  C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   2   error LNK2001: unresolved external symbol _cvWaitKey    C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   3   error LNK2001: unresolved external symbol _cvNamedWindow    C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   4   error LNK2001: unresolved external symbol _cvLoadImage  C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   5   error LNK2001: unresolved external symbol _cvShowImage  C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   6   error LNK2001: unresolved external symbol _cvReleaseImage   C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
  Error   7   error LNK1120: 6 unresolved externals   C:\Users\Jos\documents\visual studio 2010\Projects\ocv\Release\ocv.exe  ocv
  </code></pre>
  
  <p>And Here is the code:</p>
  
  <pre><code>#include "highgui.h"
  
  int main(int argc, char **argv) {
      IplImage* img = cvLoadImage(argv[1],CV_LOAD_IMAGE_UNCHANGED);
      cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE);
      cvShowImage("Example1",img);
      cvWaitKey(0);
      cvReleaseImage(&amp;img);
      cvDestroyWindow("Example1");
  }   
  </code></pre>