Library Infrastructure, HaXml and Windows

Malcolm Wallace Malcolm.Wallace at
Tue Jan 20 15:58:38 EST 2004

Graham Klyne <GK at> writes:

> Thanks, your recipe was helpful to get me started.  I'm trying to turn this 
> into a Windows batch file, which I'll post back for your consideration 
> (work-in-progress copy below).
> I notice that the Win32 distribution of GHC does not include ar, so I've 
> located and downloaded a MinGW kit.

It might be possible that you can use gcc's ld to build the archive,
using some options like  "--dll --out-implib file.a" although I can't
be sure from the manual page whether this is really the right thing.

> Compiling the source kit, I find module:
>     Text/XML/HaXml/Validate.hs
> imports FiniteMap when what is provided by GHC is Data.FiniteMap.

Yup, FiniteMap was the old name (still available in package lang I
think), but Data.FiniteMap should be essentially identical.

> Copying the .hi files to the imports directory tree, I find that one 
> existing file (from the GHC installation) is requested to be overwritten:
>    Overwrite C:\DEV\ghc\ghc-6.2\imports\Text\PrettyPrint\HughesPJ.hi

Ah, yes, Text.PrettyPrint.HughesPJ is only included in the HaXml
distribution for backward compatibility with older compiler versions
that didn't have it.  Probably best to remove the source from the
tree before building.

> ghc-pkg.exe --add-package  0<pkg.conf
> Reading package info from stdin... done.
> Expanding embedded variables... done.
> warning: can't find GHCi lib `HSHaXml.o'
> Saving old package config file... done.
> Writing new package config file... done.

I always get the same error too (on Linux and Solaris), even though
the file does exist.  Must be a bug in ghc-pkg.


More information about the Libraries mailing list