Important: Please read the Qt Code of Conduct -

MinGW cross compilation on CentOS 8

  • For a CI/CD chain I need to be able to cross-compile Qt projects on CentOS 8, for Windows (MinGW). Unfortunately I have not been able to get it working. It needs to run locally since I can only run local agents on my Bamboo install (it's the 10$ version).

    What I have attempted so far is to compile Qt from source using the mingw package from the RHEL repos, which results in compilation errors due to missing headers. Adding the missing header only resulted in more compilation errors.
    Next I attempted to build mingw from source but the instructions of how to do that are extremely vague/incomplete and based on old versions. So that was a complete failure too.
    As a last attempt I hoped using the Windows compiler + wine would work, but using qmake.exe results in an error when adding it to the toolchain.

    Has anyone:

    • succesfully gotten mingw cross-compilation working on CentOS? If so how?
    • got any idea where an up-to-date instruction can be found for mingw (on CentOS preferably)?
    • other ways to cross-compile for mingw using a local Bamboo agent?

  • Lifetime Qt Champion

    Hi @Sillie_wous,

    I'm not sure that helps you, but I used MXE to get a cross-MinGW with Qt libraries on my Ubuntu workstation. It worked flawlessy back then and I can cross-compile my apps for Windows on Linux now.


  • For future reference MXE does the trick for me too. Make sure to use the latest gcc version while building MXE (add MXE_PLUGIN_DIRS += plugins/gcc10 to otherwise you'll be compiling with c++ 11.

Log in to reply