Skip to content

Building the Qt v6 Framework from Linux

Purpose

Due to the GCC Bugzilla – Bug 116159 libraries (DLL's) build from Windows cannot be mixed with libraries build from Linux since the stdc++-6.dll is not compatible between the two.
Wine somehow solves this issue, but it is not a solution since the application must be able to run on Windows as well.

To circumvent this issue, the option is to build the Qt Framework fully from Linux using its MinGW cross-compiler and libraries.

Research & Implementation

Building the Framework

Researching the possibility of compiling the Qt Framework from Linux. To make the Qt CMake project using the MinGW cross-compiler, the following CMake options must be set:

  • The toolchain using CMAKE_TOOLCHAIN_FILE.
  • The host path using QT_HOST_PATH for Qt tools like rcc for compiling Qt resources.
    When compiling from Linux the rcc.exe cannot be executed on Linux and must come from the compiled Linux Qt Framework.

For this build-qt-lib.sh has been changed.

Using the Framework

The QT_HOST_PATH must also be set when using the Qt Framework otherwise an error occurs in the Qt framework CMake file check for dependencies.
For this the Git cmake-lib library file SfQtLibraryConfig.cmake is changed to set the QT_HOST_PATH variable according the current QT_VER_DIR.

Conclusion

After all of this, the issue of hanging threads at QApplication destruction exit still persists.