HOW TO: Install Qt SDK on wine (running on GNU/Linux).
-
I'm currently using a VM with Windows 10 that has Qt SDK installed to build and test the Qt base projects I'm working on. Windows is giving me too many headaches so I though that maybe I could try installing the Qt SDK on wine and do my work there and reduce my headaches.
Unfortunately, installing the Qt SDK on wine did not succeed. The online installed starts but gets stuck at "Performing license pre-conditions check...".
The console shows many "0108:fixme:netprofm:connection_GetAdapterId 048B6370, 0538DAE8" messages.
So I would like to ask if anyone succeeded at installing the Qt SQK on wine?
-
Hi, I just tried it on Wine on Ubuntu 20.04, by downloading the online installer, which refused to start:
wine qt-unified-windows-x86-4.3.0-1-online.exe [25] Warning: Qt Account settings file [C:\\users\\henry\\Application Data\\Qt\\qtaccount.ini] does not exist. [27] Warning: Could not find Qt Account. [640] Warning: No QtAccount credentials found. Please login via the maintenance tool of the SDK.
Then I copied the MaintenanceTool.exe (just the .exe file) from my Windows 10 PC, try to start it:
wine MaintenanceTool.exe No marker found, stopped after 1.00 MB.
Then I tried the online installer again, got the same errors but the UI lighted up :-)
While typing my email and password it spammed "Warning: No QtAccount..." but it installed Qt 6.2.4 just fine :-)
However, doing wine C:\Qt\Tools\QtCreator\bin\QtCreator didn't work. got:
02b:err:combase:RoGetActivationFactory Failed to find library for L"Windows.System.UserProfile.GlobalizationPreferences"It looks like a Qt6 error, an older version of Qt Creator might work...
-
After trying several approaches I got it to (kind of) work so I may as well post it here in case someone else find it useful.
I could not get the installer to work on wine but it works on my Windows 10 installation. In fact it was already installed there so instead of installing on Wine I tried to use that installation from wine. My Windows 10 installation is in a NTFS formatted partition on one of the drives. This way it can be booted both in a virtual QEMU/KVM machine and as a normal dual boot. It also makes it trivial to mount the partition on my GNU/Linux system.
After mounting the Windows 10 partition and configuring Wine to show the partition as a drive (D:), the Qt SDK installation was accessible from Wine.
Trying to run Qt Creator was a bust. It did not work at all but the CLI tools worked. cmake, gcc, ninja, qmake, bin tools, all worked.
After a bit of trial and error I wrote a script that would call cmake to build my project.
The following bash script is particular to my system but the basic idea is to set the PATH (through WINEPATH) to point to all the needed binaries and to pass a bunch of paths to cmake so that it can find the stuff it needs.
Hope this helps others.
#!/bin/sh export WINEPATH="D:/Qt/Tools/mingw900_64/bin;D:/Qt/Tools/Ninja;D:/Qt/Tools/CMake_64/bin;D:/Qt/6.2.3/mingw_64/bin" export WINEDEBUG=fixme-all export PROJECT="foobar" function setup { BUILD_TYPE="$1" SUB_PROJECT="$2" wine "D:/Qt/Tools/CMake_64/bin/cmake.exe" \ -S E:/work/$PROJECT/$SUB_PROJECT \ -B E:/tmp/mingw64/$PROJECT/$SUB_PROJECT/$BUILD_TYPE \ -GNinja \ -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE \ -DCMAKE_PROJECT_INCLUDE_BEFORE:PATH="D:/Qt/Tools/QtCreator/share/qtcreator/package-manager/auto-setup.cmake" \ -DQT_QMAKE_EXECUTABLE:STRING="D:/Qt/6.2.3/mingw_64/bin/qmake.exe" \ -DCMAKE_PREFIX_PATH:STRING="D:/Qt/6.2.3/mingw_64" \ -DCMAKE_C_COMPILER:STRING="D:/Qt/Tools/mingw900_64/bin/x86_64-w64-mingw32-gcc.exe" \ -DCMAKE_CXX_COMPILER:STRING="D:/Qt/Tools/mingw900_64/bin/x86_64-w64-mingw32-g++.exe" } function build { BUILD_TYPE="$1" SUB_PROJECT="$2" wine D:/Qt/Tools/CMake_64/bin/cmake.exe \ --build E:/tmp/mingw64/$PROJECT/$SUB_PROJECT/$BUILD_TYPE \ --target all } mkdir -p ~/tmp/mingw64/$PROJECT if [ "$1" != "" ]; then setup "$1" "$2" && build "$1" "$2" exit $? fi for BUILD_TYPE in Debug Release MinSizeRel RelWithDebInfo ; do for SUB_PROJECT in lib gui tui cli ; do setup $BUILD_TYPE $SUB_PROJECT || exit $? done done for BUILD_TYPE in Debug Release MinSizeRel RelWithDebInfo ; do for SUB_PROJECT in lib gui tui cli ; do build $BUILD_TYPE $SUB_PROJECT || exit $? done done exit 0
-
Just to add some more info on how use Qt on Wine: I tried today (on Ubuntu 20.04) installing a Qt Creator based on Qt5, I downloaded this one: https://download.qt.io/snapshots/qtcreator_qt5/7.0/7.0.1/134/
It works fine:
And you can use it to compile and run Qt 6.2.4 MinGW programs :-)