2017-09-02 4 views
1

私はHaskellプログラミングに新しく、Cabalを使用して最初の適切なプロジェクトを作成する過程でエラーが発生しました。Cabalインストールのリンクエラー

私はプロジェクトを構成するときにthisチュートリアルに続いた。私はcabal install base integer-gmp ghc-prim rts --reinstall実行しようとしてい

cabal: Entering directory '.' 
Configuring CabalTest-0.1.0.0... 
Building CabalTest-0.1.0.0... 
Preprocessing executable 'CabalTest' for CabalTest-0.1.0.0... 
Linking dist/dist-sandbox-fe048ba8/build/CabalTest/CabalTest ... 
/usr/bin/ld: cannot find -lHSbase-4.9.1.0 
/usr/bin/ld: cannot find -lHSinteger-gmp-1.0.0.1 
/usr/bin/ld: cannot find -lHSghc-prim-0.5.0.0 
/usr/bin/ld: cannot find -lHSrts 
collect2: error: ld returned 1 exit status 
`gcc' failed in phase `Linker'. (Exit code: 1) 
cabal: Leaving directory '.' 

にそれがRTSを見つけることができないという回答:私はcabal install -jを入力する必要がありましたステップに着いたときしかし、私は次のエラーを得ました。 cabal updateが助けにはならなかったの実行とのいずれか何もしませんでしたuser-install: Falseを含めるように〜/ .cabal/configファイルを変更

cabal: Could not resolve dependencies: 
next goal: base (user goal) 
rejecting: base-4.10.0.0, base-4.9.1.0, 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 (only already installed instances can 
be used) 
rejecting: base-3.0.3.2 (conflict: base => base>=4.0 && <4.3) 
rejecting: base-3.0.3.1 (conflict: base => base>=4.0 && <4.2) 
Dependency tree exhaustively searched. 

Note: when using a sandbox, all packages are required to have consistent 
dependencies. Try reinstalling/unregistering the offending packages or 
recreating the sandbox. 

:私はRTSを除外するようにコマンドを変更した場合、それは代わりに、これを出力します。

答えて

2

私はこの問題を解決しました。それは、私がパックマン(私はアーチlinuxを使用しています)を通して得たGHCパッケージに起因することが判明しました。ここで問題となるのは、GHCがライブラリにリンクしようとすると、静的にそのライブラリがリンクしようとするときです。しかし、GHC用のパックマンパッケージには必要な静的ライブラリは含まれていません。この問題を解決するために、すべての静的ライブラリを含むghc-staticという別のパッケージをインストールする必要がありました。

関連する問題