[Haskell-cafe] When is extra-libraries config in .cabal

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Jul 13 13:27:12 EDT 2007

On Fri, 2007-07-13 at 12:05 -0400, Edward Ing wrote:
> I am building and running some haskelldb/HDBC/HSQL libraries on
> Windows XP (using the MinGW minimals system (MSYS))  with GHC
> environment.
> I ran into runtime link problems, foreign functions would not found.
> eg. atoi,from C standard; recv from sockets.
> To solve the problem, I added dll's to the build configuration field
> "extra-libraries", MSVCRT (c runtime), KERNEL32, WSOCK32 (sockets).
> This solved the problem.
> 1. But is there a better way to solve the problem? I am expecting that
> those libraries are available through the OS and do not need explicit
> loading. I am confuse by what does the loading of the libraries.

> 2. Does a UNIX/POSIX system not have this problem?

On unix the C compiler generally links to the standard C library without
you having to ask for it explicitly.

I'm not sure that if we automatically linked to msvcrt that everyone
would be happy. Many people seem to think msvcrt is to be avoided in
preference of 'native' win32 calls.

> Information for understanding this problem would be great.

This is a slightly tricky problem because the names of the libraries to
link to are different on different operating systems.

We don't have a proper solution to this at the moment. I'm posting this
to the cabal-devel list in case anyone has any good practical realistic


More information about the cabal-devel mailing list