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.