在Windows 8下在Eclipse上运行OpenCV项目

时间:2014-07-15 21:19:47

标签: c++ eclipse opencv include mingw

我使用mingw-32从源代码构建了opencv。我想为opencv开发配置eclipse,但是我在eclipse中创建了一个简单的opencv“hello world”项目并添加了include dir和libs,但它的构建却没有使用Eclipse运行。

这是我的c ++代码

#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;
}

我的项目文件夹

enter image description here

包含路径

enter image description here

Libs路径和库

enter image description here

我认为这不是与opencv安装相关的问题,因为项目已正确构建。我试图执行由构建生成的de .exe,并出现以下错误:

enter image description here

在Eclipse中构建日志

enter image description here

OpenCV版本2.4.9 mingw 4.8海湾合作委员会 Windows 8

OpenCV是用mingw构建的。它是正确安装的,因为我通过qt creator创建了一个opencv项目并且它有效。

提前致谢

0 个答案:

没有答案