huihut / OpenCV-MinGW-Build

👀 MinGW 32bit and 64bit version of OpenCV compiled on Windows. Including OpenCV 3.3.1, 3.4.1, 3.4.1-x64, 3.4.5, 3.4.6, 3.4.7, 3.4.8-x64, 3.4.9, 4.0.0-alpha-x64, 4.0.0-rc-x64, 4.0.1-x64, 4.1.0, 4.1.0-x64, 4.1.1-x64, 4.5.0-with-contrib, 4.5.2-x64
https://opencv.org/
928 stars 215 forks source link

crash when calling in program #34

Open Sutter099 opened 11 months ago

Sutter099 commented 11 months ago

I have tried some versions like 3.4.9 and 4.1.1. Things work well with opencv objects like:

// cv_test.cpp main()
Point3d all_points[][2] = {
        Point3d( 0.0, 0.0, 0.0 ),
        Point3d( 1.0, 0.0, 0.0 ),

        Point3d( 0.0, 2.0, 0.0 ),
        Point3d( 1.0, 1.0, 0.0 ),

        Point3d( 0.0, -2.0, 0.0 ),
        Point3d( 1.0, -1.0, 0.0 ),
    };

cv::Mat tmp = cv::Mat::zeros(512, 512, CV_8UC1);

However, when it comes to imread() and imshow(), I can still compile my program successfully, but running the exe, it crashes immediately. I guess it is about the dynamic link library...

// cv_test.cpp main()
    cv::Mat my_pic = cv::imread("./my_pic.png", cv::IMREAD_GRAYSCALE);
    cv::imshow("my_pic", my_pic);

// gdb output
(gdb) start
During startup program exited with code 0xc0000135