问题
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:
- Download and extract OpenCV 2.4.2 to F:\Applications\opencv
- Create new eclipse C++ project
- under project properties under c/c++ build > settings > GCC C++ Compiler > Includes > Include Paths (-I) I have added "F:\Applications\opencv\build\include\"
- under MinGW C++ Linnker > Libraries > Libraries (-l) I have added "opencv_core242", "opencv_imgproc242", "opencv_highgui242"
- 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.
回答1:
I found the problem, I had to add F:\Applications\opencv\build\x86\mingw\bin; to my system path
来源:https://stackoverflow.com/questions/12621155/configuring-eclipse-cdt-and-opencv