Building GHC on Windows

kyra kyrab at
Thu Mar 13 10:16:34 UTC 2014

On 3/13/2014 13:18, Jan Stolarek wrote:
> I'm trying to build GHC on 64-bit Windows 7. I installed Cygwin, GHC and cloned the main repo but
> when I run configure I get this error:
> configure: Building in-tree ghc-pwd
> checking for path to top of build tree... cygwin warning:
>    MS-DOS style path detected: C:/cygwin64/home/tewi/head
>    Preferred POSIX equivalent is: /home/tewi/head
>    CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>    Consult the user's guide for more details about POSIX paths:
> C:/cygwin64/home/tewi/head
> checking for gcc... C:/cygwin64/home/tewi/head/inplace/mingw/bin/gcc.exe
> checking whether the C compiler works... no
> configure: error: in `/home/tewi/head':
> configure: error: C compiler cannot create executables
> See `config.log' for more details
> I have gcc installed under Cygwin, but for some reason ./configure is looking for an in-tree
> compiler. I tried passing --with-gcc=/usr/bin/gcc to configure but with no result. Help?
> Janek
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at
Windows GHC *shall* use in-tree compiler. Windows GHC does *not* use 
cygwin runtime at all!

Now the best way to build GHC on Windows is to use MSYS2:

I'd also add that most recent versions are
for 32-bit windows,

for 64-bit windows.

Please, take into account this is *build environment* and in no way is 
related to gcc compiler and runtime used by GHC on Windows.


More information about the ghc-devs mailing list