[darcs-users] MinGW compile problem

David Roundy droundy at abridgegame.org
Fri Nov 14 13:09:17 UTC 2003

On Fri, Nov 14, 2003 at 02:49:59AM +0100, Gour wrote:
> After compling wxWindows & wxhaskell with MinGW compiler (MSYS environment),
> I am trying to compile darcs on Win98 (under win4lin on Gentoo).
> Compling fails on not-declared entities from mman.h i.e.:
> <snip>
> ghc   -optc-O2 -c fpstring.c
> fpstring.c: In function `my_mmap':
> fpstring.c:73: `PROT_READ' undeclared (first use in this function)
> fpstring.c:73: (Each undeclared identifier is reported only once
> fpstring.c:73: for each function it appears in.)
> fpstring.c:73: `MAP_SHARED' undeclared (first use in this function)
> fpstring.c:74: `MAP_FAILED' undeclared (first use in this function)
> make: *** [fpstring.o] Error 1

I've moved Peter's win32 mmap into fpstring.c, so the mmap problem should
go away.  I don't have a cross-ghc, but I do have a mingw cross compiler,
so I was able to test that fpstring.c would at least compile.

On zlib_helper.c there's more trouble.  The problem here is that I use
pthreads to do the writing to disk while reading from the other end of a
pipe that is written to by haskell.  I can see a couple of solutions.  One
is to link with the pthreads-win32 library:


That would definitely be easiest from the darcs side, but maybe a pain for
the person who's trying to compile darcs.

I've made an attempt at converting zlib_helper to use win32 threads (with
the help of a win32 threads tutorial), so if you have a linux darcs working
you can try pulling the changes to see if they work under windows.  Note
that either way, you'll have to have zlib installed.  Also note that I
don't have windows, so it's completely untested.
David Roundy

More information about the darcs-users mailing list