Compiling MinGW-GDC on Windows

In the past days is struggeled compiling MinGW-GDC on Windows, so here is a full list of instructions what needs to be done:

  • Install msys-git aviable from http://git-scm.com/
  • Start a git console and type

    if this prints “true” you need to run

    For more information see: https://help.github.com/articles/dealing-with-line-endings
  • cd to the folder where you want the GDC sources stored and then do
  • Open a random text file in the GDC folder and make sure it actually has LF (Linux-Style) line endings. If not you did something wrong.
  • Download the mingw-get installer from www.mingw.org
    During installation make sure you pick the “Download latest repository catalogues” option.
    When you are asked which components to install pick:

    • C Compiler
    • C++ Compiler
    • MSYS Basic System
    • MinGW Developer ToolKit
  • Now start a msys command shell
  • Execute
  • Create a folder named “crossdev” directly in the root of your C: drive. (Make sure you have at least 4 gigs of space left)
  • Execute
    And make sure it has the follwing contents (assuming you installed MinGW to C:\MinGW)
  • Now cd to the directory where you checked the sources out to and execute
    When the script is done the compiled gdc will be stored in C:\crossdev\gdc64\v2\release

Known Issues

  • The script gets stuck after printing “Checking if the compiler has the remainder bug…”
    If this happens just kill the conftext.exe with the taskmanager
  • Compile errors in options.c
    GDC/gcc/d/lang.opt has CRLF line endings, make sure you have LF line endings in the whole GDC source tree
  • Compile errors while building libppl containting “itimervalue”
    Once again CRLF line ending issues. Make sure that all the source files you checked out have LF line endings.