Ask Your Question

Revision history [back]

Error while running the program : "program has stopped working"

I built OpenCV 4.0.0-pre from source using MinGW (tdm-1) 5.1.0 which was shipped along with codeblocks. My build and install were successful on windows 10. image

Now, to check my built library I ran a sample program,

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

using namespace cv;
using namespace std;

int main( )
{    
  // Create black empty images
  Mat image = Mat::zeros( 400, 400, CV_8UC3 );

  // Draw a line 
  line( image, Point( 15, 20 ), Point( 70, 50), Scalar( 110, 220, 0 ),  2, 8 );
  imshow("Image",image);
  cout<<"******************";
  waitKey( 0 );
  return(0);
}

Using below command I can compile my program and get the executable

g++ -std=c++11 OpenCVTest.cpp -llibopencv_core400 -llibopencv_highgui400 -llibopencv_imgproc400

But on running the program, I am getting program has stopped working pop up. image

Had raised this issue on OpenCV Github repo but didn't got any answer. github issue

Any help would be appreciated. Thanks..