Configuring eclipse CDT and openCV

混江龙づ霸主 提交于 2019-12-09 21:01:25

问题


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.


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!