title: OpenCV hello world not compiling like it should
body: <p>I am setting up a new machine with OpenCV 2.3.1.  The machine is a Windows 7 box, and I followed the installation instructions given by the OpenCV website (used CMake with MinGW to build).</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  int main() {
      char var;
      cv::Mat img;
      img = cv::imread("C:/test/img.jpg");
      cv::namedWindow("Image");
      cv::imshow("Image", img);
      std::cin &gt;&gt; var;
      return 1;
  }
  </code></pre>
  
  <p>Here is my make command:</p>
  
  <pre><code>g++ -o main main.cpp -lopencv_core -lopencv_imgproc -lopencv_calib3d -lopencv_video -lopencv_features2d -lopencv_ml -lopencv_highgui -lopencv_objdetect -lopencv_contrib -lopencv_legacy
  </code></pre>
  
  <p>Here is my path:</p>
  
  <pre><code>C:\OpenCV-2.3.1\install\bin;C:\OpenCV-2.3.1\install\include;C:\QtSDK\QtCreator\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake 2.8\bin;C:\QtSDK\mingw\bin;
  </code></pre>
  
  <p>Here is my error:</p>
  
  <pre><code>main.cpp:2:33: error: opencv2/core/core.hpp: No such file or directory
  main.cpp:3:39: error: opencv2/highgui/highgui.hpp: No such file or directory
  main.cpp: In function 'int main()':
  main.cpp:8: error: 'cv' has not been declared
  main.cpp:8: error: expected ';' before 'img'
  main.cpp:9: error: 'img' was not declared in this scope
  main.cpp:9: error: 'cv' has not been declared
  main.cpp:10: error: 'cv' has not been declared
  main.cpp:11: error: 'cv' has not been declared
  </code></pre>
  
  <p>This is not making sense.  Why won't this compile?  Why can't it find opencv2/core/core.hpp?  </p>