QT "Could not find the Qt platform plugin "xcb" "

11,602

1. Install requirements:

sudo apt install make g++ pkg-config libgl1-mesa-dev libxcb*-dev libfontconfig1-dev libxkbcommon-x11-dev python libgtk-3-dev
  • python is optional for QtQuick.
  • libgtk-3-dev optional if you want the GTK native theme for QtWidgets.

2. Configure:

./configure -opensource -confirm-license -nomake tests -nomake examples -prefix /path/to/install/dir

3. Compile:

make -j $(nproc)

make install
Share:
11,602

Related videos on Youtube

Voursstreds
Author by

Voursstreds

A computer engineering student at Boğaziçi University.

Updated on June 04, 2022

Comments

  • Voursstreds
    Voursstreds about 2 years

    I tried to install QT-everywhere 5.15 open-source for academic reasons, but I have failed to run a program.

    Firstly, I compiled the necessary source files with make and installed the QT Creator, then I selected the qmake for running programs inside it. When I tried to run an example program, I encounter with a problem saying this:

    qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/usr/lib/x86-64-linux-gnu" 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. The program has unexpectedly finished. The process was ended forcefully.

    Then I looked the /usr/lib/x86-64-linux-gnu folder for finding the xcb plugin and setted LD_LIBRARY_PATH=/usr/lib/x86-64-linux-gnu, but again the same error is appeared.

    What should I do to solve this problem?

    Thanks.

    • ypnos
      ypnos about 4 years
      You could try to set QT_DEBUG_PLUGINS=1 for more information. Do you have /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so? This is where it is supposed to be.
  • Mitch
    Mitch over 2 years
    It's easy to forget the XCB packages if you build Qt on a new machine. I didn't get a single error during the build, either. For reference, here's an extensive list of commands to get XCB packages on various distros (see the "Libxcb" section): wiki.qt.io/Building_Qt_5_from_Git#Linux.2FX11