Problem Description
I'm using Ubuntu 20.04 via Oracle VM Virtual Box and I faced exactly the same error as all other people.
After building Qt6 source code using official Qt manual, I'm trying to run different projects to test if everything works properly. Console-type projects build and run properly. There are no errors. Unfortunately, when I try to run a widget-type application, it fails with the well-known error:
```none
t.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.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
```
My colleague, who has Qt6 working properly on his Ubuntu, saw that I don't have `libqxcb.so` in the `.../qtbase/plugins/platforms`, and shared it with me.
Unfortunately, it didn't help much. Only the error message has changed a bit: it says that plugin was found, but couldn't be used.
The below command had no impact:
```sh
sudo apt install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0
```
Also, there's more verbose output with environmental variable `QT_DEBUG_PLUGINS=1`:
```none
QFactoryLoader::QFactoryLoader() checking directory path "/home/curiouspan/qt6-build/qtbase/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/curiouspan/qt6-build/qtbase/plugins/platforms/libqeglfs.so"
Found metadata in lib /home/curiouspan/qt6-build/qtbase/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archreq": 1,
"className": "QEglFSIntegrationPlugin",
"debug": true,
"version": 393728
}
Got keys from plugin meta data QList("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/home/curiouspan/qt6-build/qtbase/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /home/curiouspan/qt6-build/qtbase/plugins/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"archreq": 1,
"className": "QLinuxFbIntegrationPlugin",
"debug": true,
"version": 393728
}
Got keys from plugin meta data QList("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/home/curiouspan/qt6-build/qtbase/plugins/platforms/libqminimal.so"
Found metadata in lib /home/curiouspan/qt6-build/qtbase/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org....
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?