Error run gui prigram at debian (QXcbConnection Could not connect to display)

Hi!
I have compile the gui program by QT5.9 (sudo apt install qt5-default).
The compiling complete finely at lxqt and debian9:

sudo apt install qt5-default
cd program_directory
make clean
make

At lxqt, the binary program runs finely. But lxqt take up too much space, so I need in debian9.
But at debian9, running the binary file returns an error:
QXcbConnection: Could not connect to display

I have made:
export DISPLAY=:0.0
sudo apt install libffi-dev phantomjs gksu

But the error is still present.

Also I can run the gui program at debian9 from another PC by:
ssh -X 192.168.X.X -l debian
but this doesn’t solve the problem.

Please help.

Hi!
I have compile the gui program by QT5.9 (sudo apt install qt5-default).
The compiling complete finely at lxqt and debian9:

  LXQT is a Desktop Environment running ON some OS; Debian is an OS.

  The LXQT image Latest Software Images - BeagleBoard IS Debian 9 (AKA:
Stretch), with the additional packages needed to run an X server (display).
The IoT image there does not have a desktop environment or X server.

At lxqt, the binary program runs finely. But lxqt take up too much space,
so I need in debian9.
But at debian9, running the binary file returns an error:
QXcbConnection: Could not connect to display

  You are going to have to add enough stuff to provide, at minimum, an X
server implementation -- and most likely you'll need a window/desktop
manager.

  Many years ago, BBB used LXDE, which is supposed to be a lighter-weight
system LXDE - Wikipedia

  You might be able to build the components you need (at the least,
session manager and display manager, along with X-Window server). Note
however that LXQT was derived from LXDE replacing GTK+ with Qt; so may not
gain all that much reverting to just LXDE.

Also I can run the gui program at debian9 from another PC by:
ssh -X 192.168.X.X -l debian
but this doesn't solve the problem.

  Because that "another PC" is providing the X server (the display
system). Your program is only a client sending X-window commands to the
system that has the display/server capability.