Details
-
Suggestion
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
None
-
- Ubuntu 22.04.4 WSL
Description
- When running an application containing Qt under WSL, the error message for missing dependencies is not clear enough. I came here from https://bugs.launchpad.net/calibre/+bug/2073474 where the calibre developers suggested I open an issue on the Qt side.
- Taking Ubuntu 22.04.4 WSL from https://www.microsoft.com/store/productId/9PN20MSR04DW as an example, I installed calibre using the following command according to the error message of calibre.
sudo apt update && sudo apt upgrade -y cd /tmp sudo apt install libegl1 libopengl0 libxcb-cursor0 libfontconfig1 libxkbcommon0 libglx0 libnss3 libxcomposite1 libxdamage1 libxrandr2 libxtst6 libxkbfile1 libxcb-xinerama0 -y sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin calibre
- At this time, entering `calibre` in Ubuntu WSL will report the following error about qt.
linghengqian@DESKTOP-96PMLO1:~$ calibre qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found. qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: minimal, offscreen, xcb, wayland-egl, eglfs, minimalegl, vkkhrdisplay, linuxfb, vnc, wayland. Aborted
- This error message does not provide a suitable way forward.
- I logged out and re-initialized this Ubuntu 22.04.4 WSL distribution to test it later, which required installing a few seemingly unrelated GUI applications before I could open `calibre` normally. That is,
sudo apt update && sudo apt upgrade -y sudo apt install gnome-text-editor gimp vlc nautilus x11-apps -y cd /tmp sudo apt install libopengl0 libxcb-cursor0 -y sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin calibre
- At this point I can use calibre just fine, even though the current WSL distribution doesn't have a browser installed. To be honest, I don't know how to upload images on bugreports.qt.io , so I uploaded the images to github. Reference https://github.com/user-attachments/assets/c7781841-c2f1-4fc2-868f-194d3bc97fe6 .
- It would be nice if qt could provide the exact `.so` filename of the missing system dependency in log so I can search for it at https://packages.ubuntu.com/ . And I also encountered a similar problem at https://github.com/ubuntu/WSL/issues/453 . Qt's Log does not indicate which `.so` files are missing when running the application.
Attachments
Issue Links
- duplicates
-
QTBUG-126021 A request to create a wiki article for setting up Qt on WSL Ubuntu.
- Closed