Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I installed 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 qmake for running programs inside it. When I tried to run an example program, I encounter this error:

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 into /usr/lib/x86-64-linux-gnu for finding the xcb plugin and set LD_LIBRARY_PATH=/usr/lib/x86-64-linux-gnu, but again the same error appeared.

What should I do to solve this problem?

like image 977
Voursstreds Avatar asked Jun 15 '20 15:06

Voursstreds


1 Answers

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
like image 85
noran Avatar answered Sep 22 '22 01:09

noran