title: Eclipse OpenCV Undefined reference and Binary not found
body: <p>This is the code that I am trying out for a basic OpenCV program. I am using OpenCV 2.4.6.</p>
  
  <pre><code>#include "opencv2/highgui/highgui.hpp"
  #include &lt;iostream&gt;
  using namespace cv;
  using namespace std;
  int main(int argc, char** argv)
  {
    Mat im = imread(argc == 2 ? argv[1] : "lenna.png", 1);
    if (im.empty())
    {
      cout &lt;&lt; "Cannot open image!" &lt;&lt; endl;
      return -1;
    }
    imshow("image", im);
    waitKey(0);
    return 0;
  }
  </code></pre>
  
  <p>Also I am using MinGW and am including the required libraries using <a href="http://share-thevision.blogspot.in/2013/02/opencveclipse-on-windows.html" rel="nofollow noreferrer">this</a> guide. On building all the OpenCV functions are declared as undefined references and the compilation generates the error message saying <strong>Launch failed. Binary not launched.</strong></p>
  
  <p>I checked the answer given <a href="https://stackoverflow.com/questions/7860657/undefined-reference-to-eclipse-c">here</a> but on applying the changes I still cannot get it to work. Where am I going wrong?</p>
  
  <p>I am using OpenCV 2.4.6 and a 64-bit windows 7.</p>