Gtk-WARNING **: 23:30:56.598: cannot open display:

hi all
i am trying to write my first opencv in windwos 10 , i’m using cygwin, my code llike below

int main( int argc, char** argv ) {
Mat img = imread( argv[1], 0 );

if( img.empty() ) return -1;

namedWindow( “E2”, cv::WINDOW_AUTOSIZE );

imshow( “E2”, img );

waitKey( 0 );

destroyWindow( “E2” );
}

compile method: compile will be success
g++ example_02-02.cpp -o example_02-02.exe -lopencv_core -lopencv_imgcodecs -lopencv_highgui

so after all when i’m trying to run the program, it couldn’t run and give this error:

Gtk-WARNING **: 23:30:56.598: cannot open display:

i need help to run away from this error

if you install xclock or xcalc or xeyes, and run any of those, does that work?

thanks for your answer

unfortunately , No neither of them are working

ok cool, so we’ve established it’s not an OpenCV issue but an issue of your environment.

you can continue to debug this by using those applets instead of OpenCV.

those applets ?
i dont understand, your mean.