gpt4 book ai didi

windows - 在 Haskell 中,如何在 Windows 上安装编码包?

转载 作者:可可西里 更新时间:2023-11-01 09:34:36 25 4
gpt4 key购买 nike

我是 haskell 的新手,我正在做一个简单的项目,但我需要运行 cabal install encoding。但是,当我这样做时,它给了我这个错误:

Configuring encoding-0.6.7.2...
setup.exe: Missing dependency on a foreign library:
* Missing (or bad) header file: system_encoding.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.
cabal.exe: Error: some packages failed to install:
encoding-0.6.7.2 failed during the configure step. The exception was:
ExitFailure 1

如何解决这个问题?

最佳答案

TL;DR: cabal install encoding -f-systemencoding


I found a few forum posts on this topic .说的最重要的是

The missing header is langinfo.h - where it originates I don't know, as I don't have it with either Msys/MinGW or Cygwin and my Cygwin is pretty large these days.

从那里,我在 Cygwin 网站上查看了 langinfo.h 的位置。 Turns out it comes with the default install of Cygwin.这是它的路径:

usr/include/langinfo.h

So I installed Cygwin ,(实际上我已经安装了它)然后我像这样运行 cabal install:

cabal install encoding --extra-include-dirs='C:\cygwin\usr\include'

注册包没有问题。


更新

虽然这确实允许您注册包,但您不能使用它。当我尝试 GHCi 时,出现了这个错误:

Loading package encoding-0.6.7.2 ... linking ... ghc: unable to load package `encoding-0.6.7.2'

我现在又卡住了。

更新2

我在 IRC 上从一位名叫 fryguybob 的先生那里得到了一些帮助。这是另一种安装方式:cabal install encoding -f-systemencoding。这对我有用

关于windows - 在 Haskell 中,如何在 Windows 上安装编码包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15424390/

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