Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

[[qanda:topic_unsolved]] Fresh build of Qt 5.15: Could not load Qt platform plugin "xcb" in "" even though it was found

$
0
0

Hello,

I've just compiled Qt 5.15 (.2) by obtaining it from download.qt.io, and obtained QtCreator via APT for Ubuntu 20.04.5 LTS. However, after downloading my application, and compiling it, it fails to start and throws the following error:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
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, webgl.

Press <RETURN> to close this window...

It seems that the plugins aren't being found at all. Realising that perhaps this problem was caused by QtCreator not knowing where the plugins are, I located my Qt installation and set up the environment variable to point to the plugins directory there:

  • export QT_PLUGIN_PATH=/lib/x86_64-linux-gnu/qt5/plugins/

Unfortunately, running this a second time didn't fix my problem. I just was told this time that the plugin can't be loaded, even though it was found:

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, webgl.

A cursory search reveals this isn't the first time anyone's run into this problem. Notably, I came across this thread from the forum. I therefore performed the following:

  1. Enabled debugging for the plugins with export QT_DEBUG_PLUGINS=1
  2. Ran the executable again

The more verbose error is as follows:

QFactoryLoader::QFactoryLoader() checking directory path "/home/tradinco/Projects/tradinco-traqc-hmi/build-frontend-Desktop-Debug/platforms" ...
Cannot load library /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so: (/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZTI20QEventDispatcherGlib, version Qt_5_PRIVATE_API)
QLibraryPrivate::loadPlugin failed on "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so" : "Cannot load library /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so: (/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZTI20QEventDispatcherGlib, version Qt_5_PRIVATE_API)"

The thread I linked earlier mentions you can solve this by simply installing a few missing packages:

sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

However, after obtaining them all, cleaning my build, and rebuilding, the same error persists (yes, even despite having libxcb-xinerama0-dev).

At this point, I'm at a bit of a loss as to how to fix this problem. I don't quite know how to wrangle with the libraries very well. I can list them here. Because this is realted to xcb, I've listed all the libraries I have present here, as an output of sudo ldconfig -p | grep "xcb":

	libxcb.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb.so.1
	libxcb.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb.so
	libxcb-xv.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xv.so.0
	libxcb-xtest.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xtest.so.0
	libxcb-xtest.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xtest.so
	libxcb-xkb.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xkb.so.1
	libxcb-xkb.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xkb.so
	libxcb-xinput.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xinput.so.0
	libxcb-xinerama.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0
	libxcb-xinerama.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xinerama.so
	libxcb-xfixes.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0
	libxcb-xfixes.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-xfixes.so
	libxcb-util.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-util.so.1
	libxcb-sync.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-sync.so.1
	libxcb-sync.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-sync.so
	libxcb-shm.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-shm.so.0
	libxcb-shm.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-shm.so
	libxcb-shape.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-shape.so.0
	libxcb-shape.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-shape.so
	libxcb-res.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-res.so.0
	libxcb-render.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-render.so.0
	libxcb-render.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-render.so
	libxcb-render-util.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-render-util.so.0
	libxcb-render-util.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-render-util.so
	libxcb-randr.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-randr.so.0
	libxcb-randr.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-randr.so
	libxcb-present.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-present.so.0
	libxcb-keysyms.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1
	libxcb-keysyms.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-keysyms.so
	libxcb-image.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-image.so.0
	libxcb-image.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-image.so
	libxcb-icccm.so.4 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-icccm.so.4
	libxcb-icccm.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-icccm.so
	libxcb-glx.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-glx.so.0
	libxcb-glx.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-glx.so
	libxcb-dri3.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-dri3.so.0
	libxcb-dri2.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libxcb-dri2.so.0
	libX11-xcb.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libX11-xcb.so.1
	libX11-xcb.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libX11-xcb.so

Hopefully someone can give me some pointers as to solving this.


Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>