ghc找不到我的阴谋已安装的软件包 [英] ghc can't find my cabal installed packages

查看:51
本文介绍了ghc找不到我的阴谋已安装的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了ghc 6.12.3,然后安装了Haskell平台.我正在尝试编译测试程序:

I've installed ghc 6.12.3, and then the Haskell Platform. I'm trying to compile a test program:

$ ghc test.hs
test.hs:3:0:
    Failed to load interface for `Bindings':
      Use -v to see a list of the files searched for.

自然,我愿意

cabal install Bindings

哪个可以正常工作,并将软件包放在〜/.cabal/lib/bindings-0.1.2中?问题是,当我再次用ghc进行编译时,它仍然找不到我已安装的软件包与阴谋集团.在详细模式下编译会给出:

Which works fine, and places the package in ~/.cabal/lib/bindings-0.1.2 The problem is, that when I go to compile again with ghc, it still doesn't find the package I've installed with cabal. compiling in verbose mode gives:

ghc -v test.hs
Using binary package database: /home/ludflu/ghc/lib/ghc-6.12.3/package.conf.d/package.cache
Using binary package database: /home/ludflu/.ghc/x86_64-linux 6.12.3/package.conf.d/package.cache

根据另一个stackoverflow用户的建议,我尝试了:

As suggested by another stackoverflow user, I tried:

ghc-pkg describe rts > rts.pkg
vi rts.pkg                      # add the /home/ludflu/.cabal/lib to `library-dirs` field
ghc-pkg update rts.pkg

但无济于事.如何将.cabal添加到要搜索的软件包目录列表中?谢谢!

But to no avail. How to I add the .cabal to the list of package directories to search? Thank you!

推荐答案

您可以使用 ghc-pkg list 检查安装了哪些软件包.可能是您需要使用 -package< pkgname> 将软件包指定为 ghc ,或者我相信将-make 添加到will触发对包括包在内的依赖关系的追逐.

You can check which packages are installed with ghc-pkg list. It may be that you need to either specify the packages to ghc with -package <pkgname> or I believe adding --make to will trigger a chasing down of dependencies, including packages.

编辑:该绑定程序包确实已过时,请参见黑客页面.这不是软件包管理问题,唯一可用的模块是 Bindings.Deprecated ,即使它是一个空模块,也可以完美地加载.我相信相关部分已经分解为 bindings-< module> ,因此,如果您想要绑定功能,则应该查看那些软件​​包.

the bindings package is obsolete indeed, see the hackage page. This isn't a package management problem, the only module available is Bindings.Deprecated, which you are perfectly able to load, even though it is an empty module. I believe the relevant parts have been broken out into bindings-<module>, so if you want the bindings functionality you should look to those packages.

这篇关于ghc找不到我的阴谋已安装的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆