qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.

For the Qt 6.5.0 release, the missing library was libxcb-cursor.so.0, resolved with

sudo apt install libxcb-cursor0

With that, the sample widget and gui projects from QtCreator run correctly built with Qt 6.5.0. libxcb-cursor.so.0 wasn’t previously needed for Qt 6.4.0.

I identified the missing library with this shell code

for l in /path/to/Qt/6.5.0/gcc_64/lib/*.so; do
  echo $l; objdump -p $l | grep NEEDED | sed "s/^/\t"/;
 done | grep xcb | awk '{print $2}' \
| while read lib; do echo $lib; dlocate $lib; done

This scans all the install Qt libraries, extracts their required dependency libraries related to xcb, then prints which debian package provides each libxcb* library. On my system it reported a debian package for each libxcb*.so library except libxcb-cursor.so.0

Leave a Comment