title: How to compile a program using OpenCV 2.4.3 with Code::Blocks?
body: <p>I've installed <a href="http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download" rel="nofollow noreferrer">Code::Blocks with MinGW</a> and OpenCV 2.4.3. I want to compile this simple program:</p>
  
  <pre><code>#include &lt;opencv2/highgui/highgui.hpp&gt;
  #include &lt;iostream&gt;
  
  using namespace cv;
  using namespace std;
  
  int main()
  {
    Mat im = imread("c:/path/to/lena.jpg");
    if (im.empty()) {
      cout &lt;&lt; "Cannot open image!" &lt;&lt; endl;
      return 1;
    }
    imshow("Image", im);
    waitKey(0);
  }
  </code></pre>
  
  <p>How to properly setup CodeBlocks for compiling the code above?</p>
  
  <p>I have installed OpenCV in <em><code>c:\opencv</code></em>.</p>