1

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

enter image description here

Include path

enter image description here

Libs path and libraries

enter image description here

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:

enter image description here

Building log in Eclipse

enter image description here

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

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – πάντα ῥεῖ Jul 15 '14 at 21:21
  • I am not having issues with compiling, my problem is trying to run through Eclipse or cmd. Eclipse does nothing when I run it and cmd pops up the error I've added to my post. I don't know if my Project wasn't built correctly so I'll add a image of building log to the original post. Thanks – alejandro zuleta Jul 15 '14 at 21:46
  • do not worry alejandro, @πάνταῥεῖ insanely tries to close everything as duplicate that contains any undefined reference expression. It will not get closed, but even if it does, I will reopen it with the binding close vote. – László Papp Jul 16 '14 at 04:53

0 Answers0