ghc 6.12.3をインストールしてから、Haskellプラットフォームをインストールしました。テストプログラムをコンパイルしようとしています:
$ 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で再度コンパイルしようとしても、cabalでインストールしたパッケージが見つからないことです。詳細モードでコンパイルすると、次のようになります。
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ユーザーによって提案されたように、私は試しました:
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を追加するにはどうすればよいですか?ありがとうございました!