Take the 2-minute tour ×

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

$ ghc test.hs
    Failed to load interface for `Bindings':

so, naturally, I do

cabal install Bindings

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

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

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

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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.

Edit: 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.

share|improve this answer
ghc-list produces a list of packages that does include Bindings. It looks like the package is deprecated - so its not being found. Adding the -package argument didn't help. I tried some of the other examples that didn't use Bindings, and they worked fine, so I'm going to obsess on some other problems! :) Thanks for your help. –  nont Jan 9 '11 at 21:52


One thing to be especially aware of, is that the packages are installed locally by default by cabal, whereas the commands

runhaskell Setup configure runhaskell Setup build runhaskell Setup install install globally by default. If you install a package globally, the local packages are ignored. The default for cabal-install can be modified by editing the configuration file.

I was getting the same error with runhaskell command. I used the cabal in the directory that had the .cabal file and was able to resolve the error.

share|improve this answer

Your Answer


