1

I have recently started learning haskell and have never used the cabal package manager before. I'm currently working on a project that requires me to user the io-streams package.

I of course already have the Haskell Platform installed on my machine. I am currently using the x86_64-core version 8.4.3 installer.

Using a Git Bash terminal on Windows 10, I have created a .cabal-sandbox/ folder (using the cabal sandbox init command), in which to house all of my downloaded packages. I have then run cabal install io-streams to download and install the package from the Hackage site. This has worked fine.

I have now come to writing my code. This is as follows:

module StreamFiles where

import System.IO.Streams.File

main:: IO ()
main = do 
         putStrLn "some text here"

However, when I come to run this, using the following steps:
1. Run the cabal repl command in the directory where the .cabal-sandbox/ folder is located.
2. I then run the following in Powershell:

Prelude> :l src/fileStreaming/streamfile.hs
[1 of 1] Compiling StreamFile       ( src\fileStreaming\streamfile.hs, interpreted )
Ok, one module loaded.
*StreamFile> main

And get the following error:

ghc.exe:  | C:\Users\UserName\source\repos\complexHaskell\.cabal-sandbox\x86_64-windows-ghc-8.4.3\network-3.0.1.0-HkosMKsQUp05NPIgp4K8kv\HSnetwork-3.0.1.0-HkosMKsQUp05NPIgp4K8kv.o: unknown symbol `if_nametoindex'
ghc.exe: unable to load package `network-3.0.1.0'

And I cannot work out why. Is this a package problem or is there a step that I have missed when pulling the packages down from the Hackage site?
Do I need to create a .cabal file using the cabal init command and require some dependencies for my imports in there??

Thanks in advance.
C.

calumj_dev
  • 25
  • 9
  • Package io-streams use network as a dependency. Have you seen it installing during cabal install io-streams call? Followed your steps on Linux and didn't encounter any troubles, haskell file loads without any problems and all packages installed are visible under $HOME/.cabal/packages/hackage.haskell.org? Can you verify if you see packages? And your missing function should be exposed by iphlpapi.dll - check if you have it. – jaroslawj Mar 22 '19 at 16:00

0 Answers0