haskell - Cabal 包安装失败

标签 haskell cabal

我正在尝试在 Windows 环境中安装 haskell HGL 包。 这是我得到的:

e:\Study\haskell>cabal install HGL
Resolving dependencies...
Configuring HGL-3.2.0.0...
Building HGL-3.2.0.0...
Preprocessing library HGL-3.2.0.0...

Graphics\HGL\Key.hs:57:8:
   Could not find module `Graphics.Win32'
   It is a member of the hidden package `Win32-2.3.0.0'.
   Perhaps you need to add `Win32' to the build-depends in your .cabal file.
   Use -v to see a list of the files searched for.
Failed to install HGL-3.2.0.0
cabal: Error: some packages failed to install:
HGL-3.2.0.0 failed during the building phase. The exception was:
ExitFailure 1

因为我是 Haskell 的新手,谷歌搜索对我帮助不大,请告诉我如何解决这个问题。

更新

提供评论中请求的命令的输出:

e:\Study\haskell\SOE\src\soe>ghc-pkg list
C:/Program Files/Haskell Platform/2013.2.0.0\lib\package.conf.d:
    Cabal-1.16.0
    GLURaw-1.3.0.0
    GLUT-2.4.0.0
    HTTP-4000.2.8
    HUnit-1.2.5.2
    OpenGL-2.8.0.0
    OpenGLRaw-1.3.0.0
    QuickCheck-2.6
    Win32-2.3.0.0
    array-0.4.0.1
    async-2.0.1.4
    attoparsec-0.10.4.0
    base-4.6.0.1
    bin-package-db-0.0.0.0
    binary-0.5.1.1
    bytestring-0.10.0.2
    case-insensitive-1.0.0.1
    cgi-3001.1.7.5
    containers-0.5.0.0
    deepseq-1.3.0.1
    directory-1.2.0.1
    fgl-5.4.2.4
    filepath-1.3.0.1
    (ghc-7.6.3)
    ghc-prim-0.3.0.0
    hashable-1.1.2.5
    haskell-platform-2013.2.0.0
    haskell-src-1.0.1.5
    (haskell2010-1.1.1.0)
    (haskell98-2.0.0.2)
    hoopl-3.9.0.0
    hpc-0.6.0.0
    html-1.0.1.2
    integer-gmp-0.5.0.0
    mtl-2.1.2
    network-2.4.1.2
    old-locale-1.0.0.5
    old-time-1.1.0.1
    parallel-3.2.0.3
    parsec-3.1.3
    pretty-1.1.1.0
    primitive-0.5.0.1
    process-1.1.0.2
    random-1.0.1.1
    regex-base-0.93.2
    regex-compat-0.95.1
    regex-posix-0.95.2
    rts-1.0
    split-0.2.2
    stm-2.4.2
    syb-0.4.0
    template-haskell-2.8.0.0
    text-0.11.3.1
    time-1.4.0.1
    transformers-0.3.0.0
    unordered-containers-0.2.3.0
    vector-0.10.0.1
    xhtml-3000.2.1
    zlib-0.5.4.1

C:\Users\Sergey\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.con
    aeson-0.6.2.1
    base-unicode-symbols-0.2.2.4
    blaze-builder-0.3.3.0
    cmdargs-0.10.5
    convertible-1.0.11.1
    cpphs-1.17.1
    data-default-0.5.3
    data-default-class-0.0.1
    data-default-instances-base-0.0.1
    data-default-instances-containers-0.0.1
    data-default-instances-dlist-0.0.1
    data-default-instances-old-locale-0.0.1
    dlist-0.6
    ghc-mod-3.1.4
    ghc-paths-0.1.0.9
    ghc-syb-utils-0.2.1.2
    haddock-2.13.2.1
    haskell-src-exts-1.14.0
    hlint-1.8.55
    hscolour-1.20.3
    io-choice-0.0.5
    lifted-base-0.2.1.1
    monad-control-0.3.2.2
    monad-loops-0.4.2
    setenv-0.1.1
    tar-0.4.0.1
    transformers-base-0.4.1
    uniplate-1.6.12


e:\Study\haskell\SOE\src\soe>cabal install Win32-2.3.0.0
Resolving dependencies...
All the requested packages are already installed:
Win32-2.3.0.0
Use --reinstall if you want to reinstall anyway.


e:\Study\haskell\expression\HGL-3.2.0.2>cabal install HGL-3.2.0.2
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: HGL-3.2.0.2
trying: HGL-3.2.0.2:+split-base
rejecting: Win32-2.3.0.0/installed-6e9... (conflict: Win32 =>
base==4.6.0.1/installed-f0c..., HGL-3.2.0.2:split-base => base>=3 && <4)
trying: Win32-2.2.2.0
rejecting: base-4.6.0.1/installed-f0c... (conflict: HGL-3.2.0.2:split-base =>
base>=3 && <4)
rejecting: base-4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0,
4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global
constraint requires installed instance)

最佳答案

如果您查看 HGL 的文档,它说明依赖关系为:

base (<2), Win32 or
base (<2), X11 or
array, base (==3.*), Win32 or
array, base (==3.*), X11

你有 base-4.6.0.1。您不满足安装包的要求。

真正的问题是,为什么您要尝试安装最后更新于 2009 年的软件包?如果您需要一个简单的图形库,请使用 gloss。如果您需要更强大的图形,请使用 Haskell 平台附带的 OpenGL

关于haskell - Cabal 包安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20306499/

相关文章:

haskell 类型

haskell - 成本敏感的折叠

function - fmap fmap如何应用于函数(作为参数)?

haskell - 如何派生此函数的类型 :

haskell - 为什么在 Haskell 中尝试从十六进制转换为十进制时得到不正确的结果?

haskell - 创建 Haskell HTTP 请求时出错

haskell - 无法使用 cabal 1.24.0.2/ghc 8.2.1 在 Ubuntu 16.10 上安装 leksah

Haskell:为什么在 cabal 下运行我的项目时我的环境变量不可用?

haskell - Cabal:仅适用于项目目录中 checkin 的库

haskell - Cabal更新 "premature end of compressed stream"错误