Skip to content
Advertisement

Raspberry PI remote debug GTK error

I’m using NetBeans IDE 8.0.2 on my Win7 machine to develop Raspberry Pi opencv C++ application. I’m building & debugging the application remotely on the Raspberry Pi from my Win7 machine.

At run time the application fails with “Gtk-WARNING **: cannot open display:” error when reaches the line:

imshow("source", src);

When I’m running the exact same application from the Raspberry Pi and not remotely via SSH everything works as expected.

Is there any way that I can configure NetBeans to open GTK windows at the Raspberry Pi?

Advertisement

Answer

The solution is to add DISPLAY=:0 Environment variable.

At File menu select Project Properties (yourprojectname) to open Project Properties window. At Categories: click Run and then click Environment, add variable name DISPLAY with value :0

Good luck

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement