My Ubuntu laptop is dead. So I'm trying to install the Haskell projects for my Hakyll blog on Windows. I didn't change anything to the source code and the stack.yaml file, and I installed the Haskell platform. The library network fails to compile. When I do
stack install network
I get these error messages:
network> * Missing (or bad) header file: HsNet.h
network> This problem can usually be solved by installing the system package that
network> provides this library (you may need the "-dev" version). If the library is
network> already installed but in a non-standard location then you can use the flags
network> --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
network> library file does exist, it may contain errors that are caught by the C
network> compiler at the preprocessing stage. In this case you can re-run configure
network> with the verbosity flag -v3 to see the error messages.
network> If the header file does exist, it may contain errors that are caught by the C
network> compiler at the preprocessing stage. In this case you can re-run configure
network> with the verbosity flag -v3 to see the error messages.
network>
-- While building package network-3.1.1.1 (scroll up to its section to see the error) using:
C:\Users\sdl96354\AppData\Local\Temp\stack-8431997fcaa12db3\network-3.1.1.1\.stack-work\dist\29cc6475\setup\setup --builddir=.stack-work\dist\29cc6475 configure --with-ghc=C:\Users\sdl96354\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\bin\ghc-8.8.4.exe --with-ghc-pkg=C:\Users\sdl96354\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\bin\ghc-pkg.exe --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\ce41ca4b\pkgdb --libdir=C:\sr\snapshots\ce41ca4b\lib --bindir=C:\sr\snapshots\ce41ca4b\bin --datadir=C:\sr\snapshots\ce41ca4b\share --libexecdir=C:\sr\snapshots\ce41ca4b\libexec --sysconfdir=C:\sr\snapshots\ce41ca4b\etc --docdir=C:\sr\snapshots\ce41ca4b\doc\network-3.1.1.1 --htmldir=C:\sr\snapshots\ce41ca4b\doc\network-3.1.1.1 --haddockdir=C:\sr\snapshots\ce41ca4b\doc\network-3.1.1.1 --dependency=base=base-4.13.0.0 --dependency=bytestring=bytestring-0.10.10.1 --dependency=deepseq=deepseq-1.4.4.0 --extra-include-dirs=C:\Users\sdl96354\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\include --extra-lib-dirs=C:\Users\sdl96354\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\lib --extra-lib-dirs=C:\Users\sdl96354\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
I don't know what should I do and I would appreciate any help.
The error states that you are missing some system library, which is a dependency of haskell network package.
So you can either learn about how haskell stack works on Windows and look at questions about compilation of network package on windows, or you can just install some GNU/Linux distribution as a virtual machine and work as usual.