Windows中带有mingw的Opencv2.4.0崩溃了 [英] Opencv2.4.0 with mingw in windows get crashed

查看:137
本文介绍了Windows中带有mingw的Opencv2.4.0崩溃了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照步骤在此SO链接中以在Windows中使用OpenCV2.4.0编译示例程序.我使用Mingw在DEVC ++和NetBeans中进行了设置.我的示例程序正在正确编译,但是当我运行exe时,应用程序崩溃.

I followed steps in this SO link to compile a sample program using OpenCV2.4.0 in windows. I made a setup both in DEVC++ and NetBeans with Mingw. My sample Program is getting Compiled properly, but when I run the exe the application get crashes.

但是在同一台机器上,我使用的是opencv2.1.0,并且编译了相同的示例程序,并且在运行该程序时没有崩溃.

But In same machine I used opencv2.1.0 and the same sample program gets compiled and there is no crash while running it.

以下是我尝试执行的示例代码:

The below is the Sample Code I tried to execute:

#include "highgui.h"
using namespace std;
int main( int argc, char** argv ) {
IplImage* img = cvLoadImage( "C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Water lilies.jpg" );
cvNamedWindow( "Sample", CV_WINDOW_AUTOSIZE );
cvShowImage( "Sample", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Sample" );
} 

更新:

我按照moskito-x链接的步骤来构建opencv,当我按配置"时,出现以下错误.我的make文件的大小也为35kb. 有什么建议可以解决这个问题吗?

I follwed as the steps as moskito-x link to build the opencv and when I press "configure", I get the following error. And my make file is also 35kb in size. Any suggestions to solve this?

推荐答案

使用"... \ opencv \ build \ x86 \ mingw \ bin"和"... \ opencv \ build \ x86"中的库\ mingw \ lib

您不能使用OpenCV-2.4.x.exe随附的库.

You can not use the libraries that come with OpenCV-2.4.x.exe.

作为论坛中的一些开发人员,我发现了.在某些系统上,无法使用预编译的"opencv 2.4.x"库.
要编译自己的程序,可以运行,但是如果尝试运行它们,则会崩溃.直到没有可用的"opencv 2.4.x"预编译库,您必须自己编译 opencv.

As some developers in forums and I find out. On some systems, the precompiled libs of "opencv 2.4.x" can not be used.
To compile your own programs, works, but it crashed if you try to run them. Until there are not functioning precompiled libs of "opencv 2.4.x , you have to compile opencv yourself.

完全忽略文件夹"... \ opencv \ build \ x86 \ mingw \ bin"和"... \ opencv \ build \ x86 \ mingw \ lib".

Ignore so the folder "...\opencv\build\x86\mingw\bin" and "...\opencv\build\x86\mingw\lib" completely.

这篇关于Windows中带有mingw的Opencv2.4.0崩溃了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆