Aly
Aly

Reputation: 16255

Configuring eclipse CDT and openCV

I am trying to configure OpenCV and eclipse CDT (Juno) in Windows 7. I have already installed MinGW and have been using eclipse with MinGW to write C++ programs. I am now trying to incorporate the OpenCV libraries. Below are the steps I have followed:

  1. Download and extract OpenCV 2.4.2 to F:\Applications\opencv
  2. Create new eclipse C++ project
  3. under project properties under c/c++ build > settings > GCC C++ Compiler > Includes > Include Paths (-I) I have added "F:\Applications\opencv\build\include\"
  4. under MinGW C++ Linnker > Libraries > Libraries (-l) I have added "opencv_core242", "opencv_imgproc242", "opencv_highgui242"
  5. under MinGW C++ Linker > Libraries > Library search path (-L) I have added "F:\Applications\opencv\build\x86\lib"

I have then tried to write the simple program:

#include "opencv2\opencv.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main(void)
{
    Mat A;
    A = imread("lena.png", CV_LOAD_IMAGE_COLOR);

    imshow("image", A);

    cout << "Done" << endl;
    return 0;
}

However nothing happens and I don't even get the "Done" message in the output. I am stumped now as I'm new to C++ and OpenCV and am not quite sure how to debug this and move forward.

Any suggestions are appreciated.

Upvotes: 2

Views: 4956

Answers (1)

Aly
Aly

Reputation: 16255

I found the problem, I had to add F:\Applications\opencv\build\x86\mingw\bin; to my system path

Upvotes: 1

Related Questions