rncbc / qpwgraph

qpwgraph - A PipeWire Graph Qt GUI Interface
https://gitlab.freedesktop.org/rncbc/qpwgraph
GNU General Public License v2.0
246 stars 15 forks source link

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" #5

Closed aj3423 closed 2 years ago

aj3423 commented 2 years ago

I tried both apt install qpwgraph and build it from source, both says:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

Then I set the plugins path:

set -x QT_QPA_PLATFORM_PLUGIN_PATH /usr/lib/x86_64-linux-gnu/qt5/plugins/

Now the error becomes:

Cannot mix incompatible Qt library (5.15.4) with this library (5.15.3)

If I use qt6:

set -x QT_QPA_PLATFORM_PLUGIN_PATH /usr/lib/x86_64-linux-gnu/qt6/plugins/

It shows:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt6/plugins/"

even the file /usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/libqxcb.so exists.

qmake --version shows: Using Qt version 5.15.4 in /usr/lib/x86_64-linux-gnu qtchooser -print-env shows:

QT_SELECT="default" QTTOOLDIR="/usr/lib/qt5/bin" QTLIBDIR="/usr/lib/x86_64-linux-gnu"

My environment is Kali Linux, root user. Any idea why? Thanks.

rncbc commented 2 years ago

install qt6-qpa-plugins ?

aj3423 commented 2 years ago

apt install qt6-qpa-plugins shows already installed, the libqxcb.so file exists, but it still cannot find plugin "xcb".

rncbc commented 2 years ago

where did you get qpwgraph from? which version? if building from source try with cmake -DCONFIG_WAYLAND=ON ... or else just ignore the warning, it's probably harmless if there are no other symptoms or ill-behaviour

aj3423 commented 2 years ago

I tried both:

  1. From apt install, it's 0.3.5-1
  2. Build from source, git log -1 shows commit 62aef10848791e5a95eefdb7de0b3eb4d8e0568e (HEAD -> main...

I tried cmake -DCONFIG_WAYLAND=ON, the output:

[I] ~/Downloads/qpwgraph > cmake -B build -DCONFIG_WAYLAND=ON

  qpwgraph 0.3.5.3git.62aef1 (Qt 5.15.4)

  Build target . . . . . . . . . . . . . . . . . . .: release

  ALSA MIDI support  . . . . . . . . . . . . . . . .: yes
  System-tray icon support . . . . . . . . . . . . .: yes

  Install prefix . . . . . . . . . . . . . . . . . .: /usr/local

-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/qpwgraph/build

And build without any error, but same problem.

rncbc commented 2 years ago

qpwgraph 0.3.5.3git.62aef1 (Qt 5.15.4)

so you're building to qt5 ? then installing or having installed qt6-qpa-plugins is of no consequence; try the equivalent to qt5 please, maybe qt5-qpa-plugins ?

oh, and now I see:

Cannot mix incompatible Qt library (5.15.4) with this library (5.15.3)

you have conflicting library installations to Qt5: maybe you ought to fix that in the first place?

btw. what distro? have you considered my own ppa, Applications (jammy) ?

aj3423 commented 2 years ago

@rncbc Indeed it's caused because qtchooser is installed by default on Kali Linux, it doesn't support qt6. I did:

  1. In dir /usr/lib/x86_64-linux-gnu/qtchooser, copy "5.conf" and "qt5.conf" to "6.conf" and "qt6.conf", and modify the contents, change "5" to "6".
  2. set -x QT_SELECT qt6
    set -x QT_QPA_PLATFORM_PLUGIN_PATH /usr/lib/x86_64-linux-gnu/qt6/plugins/

Now it runs fine. Thanks.