Building Qt on MinGW-w64
Jump to navigation
Jump to search
This article explain you how to prepare a Qt build environment with using of [mingw-w64.org MinGW-w64 toolchain] on Windows operating system. Reason of creating this article is that official MinGW assemblies of Qt are 32-bit only. MinGW-w64 gives you able to have native 64-bit builds with MinGW without usage of Visual Studio.
Prepare MinGW-w64
At first, you need to install MinGW-w64 itself!
Download MinGW-w64 installer
Open official download page: http://mingw-w64.org/doku.php/download and find the "Mingw-builds", and then open "Installation: Sourceforge" link to download the installer.
Installing MinGW-w64 assemblies
- After starting installer, you will see the greeting page, just press "next".
- On the settings page choose:
- Version: Choose the latest (7.1.0 on moment of writing this article)
- Architecture: i686 for 32-bit builds and x86_64 for 64-bit builds
- Threads: POSIX (suggested) threads are required for std::thread, std::mutex and std::future. Works slower since it's a proxy over Win32 threads. Win32 threads model will work faster, but to use std::thread, std::mutex and std::future you will need to use extra headers for them.
- Exception:
- DWARF (32-bit only, suggested for i686) can cause executables to be slightly bloated because large call stack unwinding tables have to be included in th executables.
- A method based on setjmp/longjmp (SJLJ). SJLJ-based EH is much slower than DW2 EH (penalising even normal execution when no exceptions are thrown), but can work across code that has not been compiled with GCC or that does not have call-stack unwinding information.
- Structured Exception Handling (SEH). (suggested for x86_64) Windows uses its own exception handling mechanism known as Structured Exception Handling (SEH).
- Revision: Usually has 0 only.
- Choose the installation path: Suggested to don't install into "Program files" and install just into root of any drive (for example, C:\mingw-w64\i686-7.1.0-posix-dwarf-rt_v5-rev0)
- Wait when installer will download and install your file.
To have able to build for multiple architectures please run installer again, but choose different architecture than installed.