How to fix qt.qpa.plugin: Could not find the Qt platform plugin "wayland"

#qt #linux #cli

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

[1]    3755073 IOT instruction (core dumped)  soulseekqt
  1. Install the qt5-wayland package.
# debian/ubuntu
sudo apt install qt5-wayland

# arch
sudo pacman -S qt5-wayland
  1. If it doesn’t work, try to run the program with the QT_QPA_PLATFORM environment variable set to xcb.
QT_QPA_PLATFORM=xcb [program-name]