在运行程序的时候出现 exited with code -1073741819 的错误



  • 本人是小白,请给位大神赐教~~
    我是用Qt 5.2.1+Qt creator 3.0.1,还有用cmake把opencv添加到Qt中
    然后写了一个现实图片的程序;
    进行构建的时候没有问题,但是在运行的时候就出现了exited with code -1073741819 的错误
    调试也被异常中断了。

    已经排除了opencv方面的问题了,问题应该出现在Qt上面.
    下面是程序:

    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>

    int main()
    {
    //read an image
    cv::Mat image=cv::imread("d:/1.jpg");
    //creat image window named "My Image"
    cv::namedWindow("My Image");
    cv::imshow("My Image",image);
    //wait key for 5000ms
    cv::waitKey(5000);
    return 1;
    }

    应用程序输出:
    Starting D:\QTpro\build-qt5showimage-未命名_MinGW_x86_32bit_in_D_Qt5_Qt5_2_1_Tools_mingw48_32_bin-Debug\debug\qt5showimage.exe...
    D:\QTpro\build-qt5showimage-未命名_MinGW_x86_32bit_in_D_Qt5_Qt5_2_1_Tools_mingw48_32_bin-Debug\debug\qt5showimage.exe exited with code -1073741819

    希望各位大神帮帮忙谢谢~



  • 使用“的iostream”,“cv”和“std”

    尝试:

    @#include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>

    using namespace cv;
    using namespace std;

    int main( int argc, char** argv )
    {
    if( argc != 2)
    {
    cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
    return -1;
    }

    Mat image;
    image = imread(“d:/1.jpg”, CV_LOAD_IMAGE_COLOR);   // Read the file
    
    if(! image.data )
    {
        cout <<  "Could not open or find the image" << std::endl ;
        return -1;
    }
    
    namedWindow( "My Image", WINDOW_AUTOSIZE );
    imshow( "Display window", image ); 
    waitKey(5000);
    return 0;
    

    }@



  • 退出代码是:FFFFFFFFC0000005
    应该是写入了不该写入的数值。

    建议创建一个空的控制台程序再试。



  • 谢谢~~



  • 在读入数据那行代码imread在构建的时候出了很多问题啊但是还是谢谢你
    [quote author="Guilherme Nascimento" date="1392989564"]使用“的iostream”,“cv”和“std”

    尝试:

    @#include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>

    using namespace cv;
    using namespace std;

    int main( int argc, char** argv )
    {
    if( argc != 2)
    {
    cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
    return -1;
    }

    Mat image;
    image = imread(“d:/1.jpg”, CV_LOAD_IMAGE_COLOR);   // Read the file
    
    if(! image.data )
    {
        cout <<  "Could not open or find the image" << std::endl ;
        return -1;
    }
    
    namedWindow( "My Image", WINDOW_AUTOSIZE );
    imshow( "Display window", image ); 
    waitKey(5000);
    return 0;
    

    }@[/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.