我正在尝试安装helm
。当我尝试安装它时,我收到此错误:
$ cabal install helm
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
helm-0.6.1 depends on sdl2-1.1.0 which failed to install.
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
当我单独安装 sdl2 时,我收到类似的消息。
$ cabal install sdl2
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
我不明白。据Hackage称,sdl2的版本是1.1,但安装它需要2.0.3版本?我已经在沙盒中和沙盒外尝试过这个。如果您认为相关,ghc-pkg list
的结果就在这里:http://pastebin.com/tFrsfPFe
顺便说一句,我使用的是 Ubuntu。
帮忙?
最佳答案
对于其他安装,可能发生(发生在我身上)的另一件事是 PKG_CONFIG_PATH 变量可能不会指向包配置文件(sdl2.pc,对我来说位于/usr/local/lib/pkgconfig 目录中)。 pkg-config 使用一些默认目录('/usr/lib/pkgconfig' 和 '/usr/share/pkgconfig'),但如果 sdl.pc 文件不在其中之一,则必须指定目录在环境变量中。您可以使用 echo $PKG_CONFIG_PATH
如果您需要设置变量,只需使用 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
(或到您的 sdl2.pc 文件所在的任何目录)
关于haskell - 无法通过 cabal 安装 sdl2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25713200/