Howto install MinGW-w64

Howto install toolchain on 64 bit Linux

You can download this install steps as complete script file from

  • Lets start with a new (empty!) directory, I used "MinGW64" on my home.
  • Set some variables make this doc here more readable. DOWNLOADS and TOOLBASE you can set to somewhere. All other variables you should not change in your first try.
  • Check your Linux machine type is 64 bit (x86_64) or not
uname -m
mkdir -p $DOWNLOADS
wget " targetting Win64/Personal Builds/sezero_20100604/$MINGW_PACK/download"
  • "sezero" does not tar'ed from base of PREFIX. So, unpack this somewhere and set softlink
mkdir -p $TOOLBASE/sezero
cd $TOOLBASE/sezero
ln -s sezero/W64_160271 $PREFIX
  • Download DDK headers from MinGW branch "testing" via SVN and copy all files over the MinGW headers
svn checkout -r 2511 $DOWNLOADS/MinGW64-ddk_test.svn
cp -a $DOWNLOADS/MinGW64-ddk_test.svn/* $PREFIX/$TARGET/include/ddk
svn diff -c 2480 >mingw64-sdkddkver.h-r2480.patch
  • Apply the patch over the headers:
patch -p0 -d $PREFIX/$TARGET <mingw64-sdkddkver.h-r2480.patch

If you loades the patch from SVN, the error from non exist ChangeLog you can ignore.

Howto check toolchain

Check, that DDK headers and Compiler can create objects

  • Create very small source
cd /tmp
echo "#include <ntddk.h>" >compiler.c
  • Set some more variables and build the object:
CFLAGS="-I$PREFIX/$TARGET/include/ddk -Wall -Os -O2"
$TARGET-gcc $CFLAGS -c -o compiler.o compiler.c
  • You should have no warnings and a file compiler.o now.
  • More tests you can get form gcc445-mingw-w64-ddk-testing-suite.tgz. There are included sources and binaries for loader and simple driver.
Community content is available under CC-BY-SA unless otherwise noted.