[Haskell-beginners] the "download" package fail to install

Henk-Jan van Tuyl hjgtuyl at chello.nl
Fri Jun 15 23:30:32 CEST 2012

On Fri, 15 Jun 2012 07:53:32 +0200, Song Zhang <vxanica at gmail.com> wrote:

> Hi
> There is a package for High-level file download based on URLs called
> "download", but failed to build on windows, If you don't know it, you can
> refer to hackage first. I compiled in C, but did not get useful massage,
> anyone can help me a little to fix that.
> cabal install download
> get a bad header file

If you give the following command, you have the source code on disk
   cabal unpack download

Try to install, with debug messages:
   cd download-0.3.2
   cabal install -v3

Near the end, you will see:
   cbits/download.h:49:15: error: 'MAXHOSTNAMELEN' undeclared here (not in a

cbits/download.h uses the macro MAXHOSTNAMELEN; on a Windows system, this
is defined in a different header file,

A simple solution is inserting the following lines after line 44 in  
   #ifdef _WIN32
   #define MAXHOSTNAMELEN 256

This results in a complaint about macro FILE not being defined; this can  
be solved by adding line:
   #include <stddef.h>

The error message now is:
   In file included from C:\DOCUME~1\Henk-Jan\LOCALS~1\Temp\1848.c:1:0:
   cbits/download.h:98:1: error: expected '=', ',', ';', 'asm' or  
   before 'FILE'

I hope someone else will solve this last(?) problem.

Henk-Jan van Tuyl

Haskell programming

More information about the Beginners mailing list