MinGW: Difference between revisions
Crisian Adam (talk | contribs) No edit summary |
Clarify, rectify. Fix link to hijacked domain. remove outdated/broken 4.8.5. Add See also |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 2: | Line 2: | ||
[[Category:Tools]] | [[Category:Tools]] | ||
[[Category:MinGW]] | [[Category: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). | |||
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 the 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. | [[Qt Creator]] supports compiling with a MinGW toolchain out of the box. | ||
| Line 9: | Line 10: | ||
There are actually different MinGW toolchains and packages available: | There are actually different MinGW toolchains and packages available: | ||
*[https://sourceforge.net/projects/mingw/ MinGW] is the original project. It only compiles for 32-bit binaries. | |||
*[https://www.mingw-w64.org/downloads/#msys2 MinGW-w64] is a fork with the original which also supports 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 targeting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW toolchain using GCC 4.4. Newer Qt 4.8 binary packages ship with a MinGW-w64 based toolchain. For Qt 5, original MinGW toolchains are no longer supported. | |||
There are binary installers | |||
=Toolchains used in Qt binary packages= | =Toolchains used in Qt binary packages= | ||
{| class="wikitable" | {| class="wikitable" | ||
! style="text-align:left;" |Qt | ! style="text-align:left;" |Qt version | ||
! style="text-align:left;" |MinGW toolchain | ! style="text-align:left;" |MinGW toolchain | ||
|- | |- | ||
|Qt 4.8.6, Qt 4.8.7 | |Qt 4.8.6, Qt 4.8.7 | ||
| Line 49: | Line 45: | ||
|[https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.3.0/threads-posix/dwarf/i686-7.3.0-release-posix-dwarf-rt_v5-rev0.7z/download mingw-builds i686-7.3.0-release-posix-dwarf-rt_v5-rev0], [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-posix/seh/x86_64-7.3.0-release-posix-seh-rt_v5-rev0.7z/download mingw-builds x86_64-7.3.0-release-posix-seh-rt_v5-rev0] | |[https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.3.0/threads-posix/dwarf/i686-7.3.0-release-posix-dwarf-rt_v5-rev0.7z/download mingw-builds i686-7.3.0-release-posix-dwarf-rt_v5-rev0], [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-posix/seh/x86_64-7.3.0-release-posix-seh-rt_v5-rev0.7z/download mingw-builds x86_64-7.3.0-release-posix-seh-rt_v5-rev0] | ||
|- | |- | ||
|Qt 5.15 | |Qt 5.15 | ||
|[https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z/download mingw-builds i686-8.1.0-release-posix-dwarf-rt_v6-rev0], [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download mingw-builds x86_64-8.1.0-release-posix-seh-rt_v6-rev0] | |[https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z/download mingw-builds i686-8.1.0-release-posix-dwarf-rt_v6-rev0], [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download mingw-builds x86_64-8.1.0-release-posix-seh-rt_v6-rev0] | ||
|- | |- | ||
|Qt 6.2.2 - | |Qt 6.0, Qt 6.1, Qt 6.2.0, Qt 6.2.1 | ||
|[https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download mingw-builds x86_64-8.1.0-release-posix-seh-rt_v6-rev0] | |||
|- | |||
|Qt 6.2.2, 6.2.3, 6.2.4 | |||
|[https://github.com/cristianadam/mingw-builds/releases/download/v11.2.0-rev1/x86_64-11.2.0-release-posix-seh-rt_v9-rev1.7z mingw-builds x86_64-11.2.0-release-posix-seh-rt_v9-rev1] | |[https://github.com/cristianadam/mingw-builds/releases/download/v11.2.0-rev1/x86_64-11.2.0-release-posix-seh-rt_v9-rev1.7z mingw-builds x86_64-11.2.0-release-posix-seh-rt_v9-rev1] | ||
| | |||
|- | |||
|Qt 6.3.0 -> | |||
|[https://github.com/cristianadam/mingw-builds/releases/download/v11.2.0-rev3/x86_64-11.2.0-release-posix-seh-rt_v9-rev3.7z mingw-builds x86_64-11.2.0-release-posix-seh-rt_v9-rev3] | |||
| | |||
|- | |||
|Qt 6.8.0 -> | |||
|[https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw1310/qt.tools.win64_mingw1310/13.1.0-202407240918mingw1310.7z mingw-builds 13.1.0-202407240918mingw1310] | |||
|} | |} | ||
| Line 64: | Line 71: | ||
#Execute <code>mingw32-make distclean</code> in order to remove all object files that was compiled with different mings versions. | #Execute <code>mingw32-make distclean</code> in order to remove all object files that was compiled with different mings versions. | ||
#Explicitly set library path by setting <code>LIBRARY_PATH</code> environment variable, for example <code>set LIBRARY_PATH=c:\mingw\lib</code>. gcc linker have a very complicated library search algorithm[1] that can result in wrong library being linked (for example, mingw can find installation of strawberry perl in PATH and use it's library). | #Explicitly set library path by setting <code>LIBRARY_PATH</code> environment variable, for example <code>set LIBRARY_PATH=c:\mingw\lib</code>. gcc linker have a very complicated library search algorithm[1] that can result in wrong library being linked (for example, mingw can find installation of strawberry perl in PATH and use it's library). | ||
= See also = | |||
* [[MinGW-64-bit]] | |||
Latest revision as of 14:56, 2 April 2026
En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh
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 the 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 is the original project. It only compiles for 32-bit binaries.
- MinGW-w64 is a fork with the original which also supports 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 targeting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW toolchain using GCC 4.4. Newer Qt 4.8 binary packages ship with a MinGW-w64 based toolchain. For Qt 5, original MinGW toolchains are no longer supported.
Toolchains used in Qt binary packages
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:
- Execute in order to remove all object files that was compiled with different mings versions.
mingw32-make distclean
- Explicitly set library path by setting environment variable, for example
LIBRARY_PATH. gcc linker have a very complicated library search algorithm[1] that can result in wrong library being linked (for example, mingw can find installation of strawberry perl in PATH and use it's library).set LIBRARY_PATH=c:\mingw\lib