tags:

views:

245

answers:

2

I have this simple code:

import Network
main = return ()

executing it with runhaskell fails:

>runhaskell test.hs
test.hs: C:\ghc\ghc-6.10.4\network-2.2.1.2\HSnetwork-2.2.1.2.o: unknown symbol `_getnameinfo'
test.hs: test.hs: unable to load package `network-2.2.1.2'

GHCi also gives simillar error message. What can I do about it?

I am using GHC 6.10.4 on Windows 2000.

+1  A: 

Likely this means the binary distribution of GHC you installed was built against a different C library to the one on your system. Try reinstalling GHC using the Haskell Platform: http://hackage.haskell.org/platform/

Don Stewart
I've installed binary distribution from GHC website, previous one (6.8.1) worked fine. Should I consider this to be a bug in 6.10.4 distribution?
robson3.14
Please try the Haskell Platform windows installer, then report back if it is still a problem: http://hackage.haskell.org/platform/
Don Stewart
Haskell Platform 2009.2.0.2 has the same problem.
robson3.14
A: 

You can use cabal to try and reinstall the package. I had similar behavior with the CGI library and forcing a reinstall fixed it.

Shaun
But how to do this?When I do this:network-2.2.1.4>runghc Setup.hs configureI've got this:Configuring network-2.2.1.4...Setup.hs: sh: runGenProcess: does not exist (No such file or directory)
robson3.14
1) cabal update 2) cabal install network --reinstall
Shaun
This will not help. There is no sh on Windows.
robson3.14
cabal comes with the Windows Haskell Platform installation. Just start->run->cmd and type the commands above.
Shaun
1. Cabal that comes with Haskell Platform doesn't work on Win2000. 2. Sh is not part of Windows nor Haskell Platform (network package requires sh). 3. I've used sh from MSys and sucesfully built network package, but the problem persists. Network package simply can not work on Win2000 because it uses functions like: getaddrinfo, freeadrrinfo, getnameinfo. Those funcs don't exist on that OS. GHC and Haskell Platform teams didn't even bother to test their code on Win2k.
robson3.14
Ok. I'll take this as a bug report against the network package on Windows 2k. Thanks. I assume you reported this today (I saw a bug report).The more users report bugs on old systems (Win2k is a decade old!) the better we can hope to have good test coverage.
Don Stewart