docker-clion-dev icon indicating copy to clipboard operation
docker-clion-dev copied to clipboard

How edit the dockerfile and yml file to show GUI?

Open opptimus opened this issue 4 years ago • 0 comments

I want to use clion on win10 with Remote Docker Container debugging Env(OpenCV 4) Of Ubuntu 18.04.I install Docker in my local machine(win10). Thanks to https://github.com/shuhaoliu/docker-clion-dev, I use your Dockerfile and yml file:

It works well with many C++ library,but I want to use OpenCV4 Library,I want to run this CPP file:

#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char* argv[]) {
    Mat src = imread("/code/001.png");

    if (src.empty()) {
        printf("cannot load images!\n");
        return -1;
    }
    namedWindow("show_photo", WINDOW_AUTOSIZE);
    imshow("show_photo", src);

    return 0;
}

It shows that: **(show images:314): Gtk-WARNING : 09:56:09.309: cannot open display:

I found some information,But they are all about entering the command line, how to modify the dockerfile and yml file?? Please master programmers help me!

My IDE is Clion on Win10,I already install Xming on win10 and knows the X0.hosts .

opptimus avatar Dec 14 '19 10:12 opptimus