How can I get the window from Linux while using Visual Studio 2017 to develop an application for Linux

  • Thread starter Thread starter colin1501
  • Start date Start date
C

colin1501

Guest
Normally, I can get the window on Linux by using Putty & Xming through SSH. Now I'm trying to finish an OpenCV application in Linux by using VS2017, how can I get the window from the Linux system when I'm debugging the application.

for example:

#include <cstdio>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
VideoCapture camera;
Mat frame;
camera.open(0);
if (!camera.isOpened())
cout << "failed to open camera!" << endl;
else
cout << "successed to open camera!" << endl;
camera.read(frame);
imshow("test", frame);
camera.release();
waitKey();
destroyAllWindows();
printf("hello from camera!\n");
return 0;
}



when I debug the code, the output is

"Unable to init server: 无法连接:拒绝连接
(test:28058): Gtk-&#27;[1;33mWARNING&#27;[0m **: cannot open display: "

(which means can not get connection: refuse to connect )

so what should I do?

Continue reading...
 
Back
Top