MinGW

From Qt Wiki
Revision as of 16:07, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English Български

MinGW

MinGW is a free and open source Windows port of the GCC compiler and related tools. Qt supports MinGW as a platform on Windows in addition to Visual Studio compiler by Microsoft. However, it can also be used as a cross-compiler e.g. on Unix (currently not officially supported).

Qt Creator supports compiling with a MinGW toolchain out of the box.

MinGW distributions and versions

There are actually different MinGW toolchains and packages available:

MinGW.org [mingw.org] is the original project. The latest version gcc 4.7.2. It only compiles for 32 bit binaries.

MinGW-w64 [mingw-w64.sourceforge.net] is a fork with the original aim to also support generation of 64 bit binaries. By now it also supports a much larger part of the Win32 API. The MinGW-w64 project does host several different binary packages, done by different people.

There are binary installers targetting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required.

Toolchains used in Qt binary packages

Qt Version MinGW toolchain
– Qt 4.8.5

The binary packages were compiled mingw.org gcc 4.4 toolchain that is unfortunately not officially provided anymore. See also this forum thread [qt.io] .

Qt 4.8.6

mingw-builds i686-4.8.2-release-posix-dwarf-rt_v3-rev3 [sourceforge.net] targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download

Qt 5.0

mingw-builds x32-4.7.2-release-posix-sjlj-rev8 [sourceforge.net]

Qt 5.1

mingw-builds x32-4.8.0-release-posix-dwarf-rev2 [sourceforge.net]

Qt 5.2, Qt 5.3

mingw-builds i686-4.8.2-release-posix-dwarf-rt_v3-rev3 [sourceforge.net] targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download

Qt 5.4

mingw-builds i686-4.9.1-release-posix-dwarf-rt_v3-rev2 [sourceforge.net] targetting Win32/Personal Builds/mingw-builds/4.9.1/threads-posix/dwarf/i686-4.9.1-release-posix-dwarf-rt_v3-rev2.7z/download

Common problems

Link error ‘Undefined reference to _Unwind_Resume’

This error occurs if object files / libraries being linked are compiled with different versions of mingw. The following steps can fix a problem:

  1. Execute
    mingw32-make distclean
    
    in order to remove all object files that was compiled with different mings versions.

1 Mingw wiki about library search problems [mingw.org]

Categories: