I've built opencv from sources using mingw-32. I want to configure eclipse for opencv development but I create a simple opencv "hello world" Project in eclipse and add include dir and libs, it builds however doesn't run using Eclipse.
This is my c++ code
#include <opencv2/highgui/highgui.hpp>
#include "iostream"
using namespace cv;
using namespace std;
int main(){
Mat img = imread("img.jpg");
if (img.empty()){
cout << "Cannot load image!" << endl;
return -1;
}
cout << "Image was loaded" << endl;
namedWindow("image", CV_WINDOW_AUTOSIZE);
imshow("image", img);
waitKey(0);
return 0;
}
My Project folder
Include path
Libs path and libraries
I think this is not a problem related to opencv installation because the Project was correctly built. I've tried to execute de .exe generated by building and the following error appears:
Building log in Eclipse
OpenCV version 2.4.9 mingw 4.8 GCC Windows 8
OpenCV was built with mingw. It was correctly installed since I created a opencv project through qt creator and it worked.
Thanks in advance