Yeah, nice, but I'd need to use a newer version of the compiler chain, because of some C++20/23 features Iʼm using and that these old versions don't yet support. So, basically using MSVC the most [or Clang on my Linux physical machine] Also, the only thing stopping me from using Qt more is the fact Qt doesn't play nice with C++20 Modules and I can't really live without Modules anymore. Nevertheless, nice video, Milo. It's always good to see stuff that tries to enhance developer experience. Being able to develop and try Linux Apps from Windows is one of them. Cheers
If you have to use Windows and work with Qt cross-platform code, it's better to use WSL, you get a faster compiler, no antivirus that slows down things, a faster debugger, etc. Heck you can even cross-compile from WSL using mingw-w64 to have Windows binaries. But there is one disadvantage, it looks like an eye-sore and doesn't look like a native application. If you do a websearch after "WSLg and Qt Creator" you will find a way to configure Qt Creator on WSLg running on Linux which looks almost the same as the windows Qt Creator version! It's not easy, but it can be done.
Hi Christian, Thanks for the tips. WSL, of course, gives you the overhead of the virtual machine that it is running in. An alternative for better development experience under Windows is the recently-released DevDrive: learn.microsoft.com/en-us/windows/dev-drive/ which has less filesystem hooks and uses higher-performance ReFS filesystem. Some of our employees reported significantly reduced compilation times with it. As for the problems with Qt Creator, stay tuned for the part 2 of this series where we'll show how to connect to your WSL environment from Visual Studio Code running on the host Windows OS.
Earlier I used VcXsrv Windows X Server and export DISPLAY=my-host-address:0 in .bashrc. It looks like native Windows app (borders and window behavior).
Hi there, That's the standard Windows 11 start menu. Linux applications like Qt Creator are dynamically added to the list of applications in the host Windows operating system start menu.
Hi there, It may be that your WSL distribution is fairly old and doesn't have the latest SSL certificates. Could you please reply with the output of command lsb_release -a (executed in WSL terminal)? This will show us what your distribution version is.
@KDABtv thank you. It's done. I have another doubt.. client asking to do on linux QT, but I'm going to propose to do with wsl ubuntu QT. Is there any problem after completing? The files can be compiled in pure linux before deployment?
Do you know if i can install it somewhere other than /opt/Qt, because I tried installing it inside ~ and my CMAKE_PREFIX_PATH keeps setting to /opt/Qt/6.5.3/gcc_64 even though there is no Qt directory there?
Hey, Miłosz speaking here, Installing to ~/ should work fine. I just tried that with Qt 6.7.2 and it worked. Are you compiling from Qt Creator? If yes, could you go to Edit→Preferences, choose the "Kits" section, open "Qt Versions" tab and see what Qt versions do you have available? If you choose one of them, there should be a "qmake path:" below. Check if the path is correct. Perhaps you have some lingering old entry for Qt in /opt in your kit settings. By the way, I discovered that newer version of Qt (6.7.2) needs some additional packages (libxcb-cursor0 libglx-dev libgl1-mesa-dev) to compile and run Qt Widgets application. Make sure to install those if you have this new Qt version.
How to fix this? qt.qpa.xcb: could not connect to display 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, xcb. Aborted
Hey, could you paste the outputs of the following commands (run in WSL terminal): ldd /opt/Qt/6.5.3/gcc_64/plugins/platforms/libqxcb.so (replace the Qt version number with the one you've installed) and ldd /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so
qt.qpa.xcb: could not connect to display 172.17.64.1:0.0 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, xcb. Aborted - i am getting this error. how to fix this?
Hey, could you paste the outputs of the following commands (run in WSL terminal): ldd /opt/Qt/6.5.3/gcc_64/plugins/platforms/libqxcb.so (replace the Qt version number with the one you've installed) and ldd /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so
Hi, Not really. "apt upgrade" will update all currently installed packages on your system. If any of the subequently installed packages would require updates to their dependencies, it will happen automatically.
In the beginning a very important topic was skipped - to turn on "virtualization" and "windows subsystem for Linux" in "Windows Features" dialog. Also I'm not sure but WSL may be not version 2 by default and need to set it either.
Hi, According to Microsoft documentation on WSL (learn.microsoft.com/en-us/windows/wsl/install#install-wsl-command) all the necessary features will be turned on automatically. And WSL2 is the default for quite some time already.
Hi, The official installer already supports commandline-based installation, see: doc.qt.io/qt-6/get-and-install-qt-cli.html Also, there's another project that provides CLI Qt installer: github.com/miurahr/aqtinstall
This error I see when trying to install the installer file on WSL. Any suggestions on fixing this? $ uname -a Linux ABC1234 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux ~/Downloads$ sudo ./qt-online-installer-linux-x64-4.8.1.run MoTTY X11 proxy: No authorisation provided qt.qpa.xcb: could not connect to display localhost:10.0 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, xcb. Aborted
Excelent video, learned a lot! Thanks.
Glad that you enjoyed the video!
This is a good intro to wsl for Qt ethusiast. Nice!
Thank you for watching! :)
Yeah, nice, but I'd need to use a newer version of the compiler chain, because of some C++20/23 features Iʼm using and that these old versions don't yet support. So, basically using MSVC the most [or Clang on my Linux physical machine]
Also, the only thing stopping me from using Qt more is the fact Qt doesn't play nice with C++20 Modules and I can't really live without Modules anymore.
Nevertheless, nice video, Milo.
It's always good to see stuff that tries to enhance developer experience. Being able to develop and try Linux Apps from Windows is one of them.
Cheers
If you have to use Windows and work with Qt cross-platform code, it's better to use WSL, you get a faster compiler, no antivirus that slows down things, a faster debugger, etc. Heck you can even cross-compile from WSL using mingw-w64 to have Windows binaries.
But there is one disadvantage, it looks like an eye-sore and doesn't look like a native application. If you do a websearch after "WSLg and Qt Creator" you will find a way to configure Qt Creator on WSLg running on Linux which looks almost the same as the windows Qt Creator version! It's not easy, but it can be done.
Hi Christian,
Thanks for the tips. WSL, of course, gives you the overhead of the virtual machine that it is running in. An alternative for better development experience under Windows is the recently-released DevDrive: learn.microsoft.com/en-us/windows/dev-drive/ which has less filesystem hooks and uses higher-performance ReFS filesystem. Some of our employees reported significantly reduced compilation times with it.
As for the problems with Qt Creator, stay tuned for the part 2 of this series where we'll show how to connect to your WSL environment from Visual Studio Code running on the host Windows OS.
Earlier I used VcXsrv Windows X Server and export DISPLAY=my-host-address:0 in .bashrc. It looks like native Windows app (borders and window behavior).
8:35 what app do u use to find qt creator in wsl?❤
Hi there,
That's the standard Windows 11 start menu. Linux applications like Qt Creator are dynamically added to the list of applications in the host Windows operating system start menu.
@@KDABtv i find it after restarting the computer several times.
you will generally have a better linux experience on bare metal or on a VM y'all.
I'm getting SSL HandShake failed error while setup of QT open source. How to resolve it?
Hi there,
It may be that your WSL distribution is fairly old and doesn't have the latest SSL certificates. Could you please reply with the output of command lsb_release -a (executed in WSL terminal)? This will show us what your distribution version is.
@KDABtv thank you. It's done. I have another doubt.. client asking to do on linux QT, but I'm going to propose to do with wsl ubuntu QT. Is there any problem after completing? The files can be compiled in pure linux before deployment?
Thank you very much! Very good tutorial!
Do you know if i can install it somewhere other than /opt/Qt, because I tried installing it inside ~ and my CMAKE_PREFIX_PATH keeps setting to /opt/Qt/6.5.3/gcc_64 even though there is no Qt directory there?
Hey, Miłosz speaking here,
Installing to ~/ should work fine. I just tried that with Qt 6.7.2 and it worked. Are you compiling from Qt Creator? If yes, could you go to Edit→Preferences, choose the "Kits" section, open "Qt Versions" tab and see what Qt versions do you have available? If you choose one of them, there should be a "qmake path:" below. Check if the path is correct. Perhaps you have some lingering old entry for Qt in /opt in your kit settings.
By the way, I discovered that newer version of Qt (6.7.2) needs some additional packages (libxcb-cursor0 libglx-dev libgl1-mesa-dev) to compile and run Qt Widgets application. Make sure to install those if you have this new Qt version.
The link to the example code no longer works. And I can't find it on github either. Is it still available?
Hi there,
the link should work again now. We're sorry for the inconvenience.
How to fix this?
qt.qpa.xcb: could not connect to display
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, xcb.
Aborted
Hey,
could you paste the outputs of the following commands (run in WSL terminal):
ldd /opt/Qt/6.5.3/gcc_64/plugins/platforms/libqxcb.so
(replace the Qt version number with the one you've installed)
and
ldd /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so
qt.qpa.xcb: could not connect to display 172.17.64.1:0.0
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, xcb.
Aborted - i am getting this error. how to fix this?
Hey,
could you paste the outputs of the following commands (run in WSL terminal):
ldd /opt/Qt/6.5.3/gcc_64/plugins/platforms/libqxcb.so
(replace the Qt version number with the one you've installed)
and
ldd /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so
@@KDABtv Hi! I also have this problem, but my opt folder is empty. This error happens before I even run my qt-installer script. How I can fix it?
Good work! Like tutorials like this.
Thank you very much! We're happy that you enjoy our videos! :)
is it necessary to run sudo apt upgrade after sudo apt update before installing new packages?
Hi,
Not really. "apt upgrade" will update all currently installed packages on your system. If any of the subequently installed packages would require updates to their dependencies, it will happen automatically.
In the beginning a very important topic was skipped - to turn on "virtualization" and "windows subsystem for Linux" in "Windows Features" dialog. Also I'm not sure but WSL may be not version 2 by default and need to set it either.
Hi,
According to Microsoft documentation on WSL (learn.microsoft.com/en-us/windows/wsl/install#install-wsl-command) all the necessary features will be turned on automatically. And WSL2 is the default for quite some time already.
@@KDABtv ah, cool
@KDAB We really need a command line Qt Installer, please, make it.
Hi,
The official installer already supports commandline-based installation, see: doc.qt.io/qt-6/get-and-install-qt-cli.html
Also, there's another project that provides CLI Qt installer: github.com/miurahr/aqtinstall
This error I see when trying to install the installer file on WSL.
Any suggestions on fixing this?
$ uname -a
Linux ABC1234 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~/Downloads$ sudo ./qt-online-installer-linux-x64-4.8.1.run
MoTTY X11 proxy: No authorisation provided
qt.qpa.xcb: could not connect to display localhost:10.0
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, xcb.
Aborted
Hi,
please apply the same solution we mentioned in your previous comment below this video.