gpt4 book ai didi

networking - 在win32/cygwin上编译haskell模块网络

转载 作者:行者123 更新时间:2023-12-05 01:08:33 26 4
gpt4 key购买 nike

我正在尝试在 win32/cygwin 上编译 Network.HTTP ( http://hackage.haskell.org/package/network )。但是,它确实失败并显示以下消息:

Setup.hs: Missing dependency on a foreign library:
* Missing (or bad) header file: HsNet.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

不幸的是,它没有提供更多线索。 HsNet.h 包含 sys/uio.h,实际上不应该包含它,并且应该正确配置。

最佳答案

不要使用cygwin,而是关注Johan Tibells方式

安装 MSYS

Install the latest Haskell Platform. Use the default settings.

Download version 1.0.11 of MSYS. You'll need the following files:
MSYS-1.0.11.exe
msysDTK-1.0.1.exe
msysCORE-1.0.11-bin.tar.gz

The files are all hosted on haskell.org as they're quite hard to find in the official MinGW/MSYS repo.

Run MSYS-1.0.11.exe followed by msysDTK-1.0.1.exe. The former asks you if you want to run a normalization step. You can skip that.

Unpack msysCORE-1.0.11-bin.tar.gz into C:\msys\1.0. Note that you can't do that using an MSYS shell, because you can't overwrite the files in use, so make a copy of C:\msys\1.0, unpack it there, and then rename the copy back to C:\msys\1.0.

Add C:\Program Files\Haskell Platform\VERSION\mingw\bin to your PATH. This is neccesary if you ever want to build packages that use a configure script, like network, as configure scripts need access to a C compiler.

这些步骤是 Tibell 用来为 win 编译 Network 包的步骤,我自己在大多数 haskell 平台版本上都成功地使用了几次。

关于networking - 在win32/cygwin上编译haskell模块网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17078997/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com