【发布时间】:2016-10-21 12:28:51
【问题描述】:
作为 uni 任务,我需要使用某些功能增强给定的 Haskell 框架。由于这个框架使用了 Gloss 库,所以我使用 cabal install gloss 安装了 Gloss。这没有给我任何错误,但是,在尝试配置框架的安装文件 (runghc Setup configure) 时,我收到以下错误消息:
Configuring lambda-wars-0.1.0.0...
Setup: Encountered missing dependencies:
gloss >=1.8 && <1.10, random ==1.0.*, time >=1.4 && <1.6
尝试安装这些依赖项(例如cabal install 'gloss >=1.8 && <1.10)会给我其他错误消息:
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: gloss (user goal)
rejecting: gloss-1.10.2.3/installed-3mE..., gloss-1.10.2.3, gloss-1.10.2.2,
gloss-1.10.2.1, gloss-1.10.1.1 (constraint from user target requires >=1.8 &&
<1.10)
trying: gloss-1.9.4.1
next goal: base (dependency of gloss-1.9.4.1)
rejecting: base-4.9.0.0/installed-4.9... (conflict: gloss => base==4.8.*)
rejecting: base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0,
base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0,
base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0,
base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0,
base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
Dependency tree exhaustively searched.
经过一些研究,我认为这意味着我的 GHC 与项目所需的版本不同。但是,我似乎无法弄清楚如何实际解决这个问题!
我在 Mac OS X 版本 10.10.5 上工作。
【问题讨论】:
-
我猜你正在使用需要/提供 base-4.9 的 ghc-8.0.x - 如果你想使用 base-4.8,你必须切换到 ghc 7.10.3,或者你可以修改光泽cabal 文件以允许 base -4.9 或使用
--allow-newer调用 cabal。 -
也不要全局安装像gloss这样的库,这只是解决问题的第一步——尝试使用stack而不是cabal。我个人尝试使用堆栈编译东西 - 并删除我要编译的项目中的所有构建依赖边界。请注意,我不会只对 cabal 这样做!
-
感谢您的评论!使用 --allow-newer 允许我配置项目,但是,运行它给了我以下错误:
lambda-wars[6771:36510] GLUT Fatal Error: pixel format with necessary capabilities not found... 这也是因为我使用 cabal 而不是 stack 的事实吗?
标签: haskell dependencies ghc gloss