GCC for Windows 64 & 32 bits

This is an old revision of the document!


Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution.

The development and community are very active and welcoming with new contributors every month and simple installers.

Version 5 has been released

5.0.1: 2017-01-06

initial Release: 2016-10-19

  • Fixes to the __mingw_printf family of functions.
  • DirectX updates from Wine.
  • Various updates to support Windows 7 and 10.
  • Various header typo fixes.

You can also look at the full list of versions.

Headers, Libraries and Runtime

  • More than a million lines of headers are provided, not counting generated ones, and regularly expanded to track new Windows APIs.
  • Everything needed for linking and running your code on Windows.
  • Winpthreads, a pthreads library for C++11 threading support and simple integration with existing project.
  • Winstorecompat, a work-in-progress convenience library that eases conformance with the Windows Store.
  • Better-conforming and faster math support compared to Visual Studio's.


  • gendef: generate Visual Studio .def files from .dll files.
  • genidl: generate .idl files from .dll files.
  • widl: compile .idl files.

Friend projects

Mingw-w64 interacts a lot with other projects in order to help everyone move forward. Contributions have been going to and coming from these projects:

Most Recent Activity

Martin Storsjö committed [5f3412]

headers: Fix the definition of _sys_errlist for ucrtbase

Martin Storsjö committed [df84f1]

headers: Hook up getc/putc_nolock for ucrtbase

Martin Storsjö committed [a6faf2]

ucrtbase: Link to the right setjmp function on archs other than x86_64

Martin Storsjö committed [674169]

headers: Make sure _ARM64_ is defined in _mingw_mac.h as well

LH_Mouse modified ticket #134

64-bit version have _WIN32=1

陈林熙 posted a comment on ticket #134

OK, I know.Thanks a lot.

Zufu Liu posted a comment on discussion Open Discussion

std::mutex and std::thread are added in C++11, you may need to upgrade you GCC to a recent x86_64-posix-seh or i686-posix-dwarf or other posix threading model GCC from https://sourceforge.net/projects/mingw-w64/files/?source=navbar. -std=gnu++11 compiler flag may also need to added in CMakeLists.txt like: if( MINGW ) add_definitions(-D__STDC_FORMAT_MACROS) add_definitions(-D__USE_MINGW_ANSI_STDIO=1) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")...

Jim posted a comment on discussion Open Discussion

I'm really trying to compile vulkanSDK shaderc, but it includes the project glslang which is a C++ project that does a #include <mutex> which fails.... https://github.com/KhronosGroup/glslang git clone https://github.com/KhronosGroup/glslang cd glslang mkdir build cd build cmake .. -G "MinGW Makefiles" make fail I did some searching for the mutex error and some things said 'windows doesn't have supprot for it' then it shouldn't build with MSVC either, but instead there is no issue. Since it's a problem...

LH_Mouse posted a comment on ticket #694

Confirmed on GCC 7.2.1 . This seems a GCC bug. Please report it to https://gcc.gnu.org/bugzilla/ .

LH_Mouse posted a comment on ticket #134

On x64 both _WIN32 and _WIN64 is defined as 1. That is what Microsoft people do and we have to follow this convention.