在控制台下无法运行qt程序,提示报错

Which system do you use? Android, Ubuntu, OOWOW or others?

ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official images

Please describe your issue below:

在控制台下无法运行qt程序

Post a console log of your issue below:

qt .qpa. xcb : could not connect to displag
qt.qpa.plugin :Could not load the Qt platform plugin "xcb"in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized . Reinstalling the application may fix this problem.
Availcation platform plugins are: eglfs , linuxfb , minimal ,minimaleg1, offscreen ,vnc,wayland-egl ,wayland ,wayland-xcomposite-egl , wayland-xcomposite-glx,xcb.
Aborted

Delete this line and post your log here.

Hello @hugh87

Are you running it in console mode and not gnome desktop ?

yes,i want to run it in console mode,how do i do that

You need to try to use export QT_QPA_PLATFORM=linuxfb to render directly on framebuffer.

How do I enable GPU acceleration in Framebuffer Console mode

@hugh87 please try using eglfs backend plugin for GPU acceleration.

How to use the EGLFS backend plugin? Can you tell me more about it?

Similar as linuxfb, need to do export QT_QPA_PLATFORM=eglfs instead.

when i use ‘export QT_QPA_PLATFORM=eglfs’ instead,the screen turns black and displays errors when i finish the program

Hello @hugh87

Do you install the QT with command apt install ? The default QT package may not support running under console, you may need to rebuild the QT package to support eglfs.

Yes,I install the QT with ‘apt install’,I will try to rebuild the QT package.