0

This is the code that I am trying out for a basic OpenCV program. I am using OpenCV 2.4.6.

#include "opencv2/highgui/highgui.hpp"
#include <iostream>
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 << "Cannot open image!" << endl;
    return -1;
  }
  imshow("image", im);
  waitKey(0);
  return 0;
}

Also I am using MinGW and am including the required libraries using this guide. On building all the OpenCV functions are declared as undefined references and the compilation generates the error message saying Launch failed. Binary not launched.

I checked the answer given here but on applying the changes I still cannot get it to work. Where am I going wrong?

I am using OpenCV 2.4.6 and a 64-bit windows 7.

Community
  • 1
  • 1
praxmon
  • 5,009
  • 22
  • 74
  • 121

1 Answers1

-2

It sounds like the compiler/linker can't find OpenCV. Where is it installed ? Are you sure the headers and dynamic libraries are available to Eclipse ? Are you sure you are linking against it ?

Olotiar
  • 3,225
  • 1
  • 18
  • 37
  • How do I check? I have just unzipped in C. And on including the header file like you have instructed it says no such file or directory and unresolved inclusion. – praxmon Jan 13 '14 at 11:50
  • nothing is wrong with `#include "opencv2/highgui/highgui.hpp"` – Alexey Jan 13 '14 at 14:36