GCC in the Windows distribution of GHC

Simon Marlow simonmar at microsoft.com
Wed Dec 7 09:04:54 EST 2005


On 07 December 2005 13:39, cschmidt at deds.nl wrote:

> The Windows distribution of GHC includes GCC. Some header files
> (such as iostream, algorithm, and so forth), however, are missing
> (at least I was not able to find them).
> 
> I could, of course, download the correct version of GCC (this must be
> version 3.2.3 for GHC 6.4), and put the header files where GCC
> can find them. I only wonder if this is the right thing to do.
> 
> Were the header files omitted just to make the distribution smaller,
> or for some other reason?

The GCC bundled with GHC is intended mainly for compiling Haskell code
via-C, and we didn't intend it to be invoked independently.  Hence, it
just contains the bits we need.

If you want to compile C files using GHC (a reasonable thing to do),
then the right thing to do is install a full GCC somewhere (eg. the
mingw gcc), and tell GHC to use it, like this:

  $ ghc -pgmc c:/mingw/bin/gcc -c foo.c

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list