簡體   English   中英

陰謀安裝鏈接錯誤

[英]Cabal install linking error

我對Haskell編程很陌生,在使用Cabal創建我的第一個適當項目的過程中遇到錯誤。

構建項目時,我遵循了教程。 但是,當我進入必須輸入cabal install -j的步驟時,出現以下錯誤:

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 '.' 

我試圖運行cabal install base integer-gmp ghc-prim rts --reinstall ,它回答說找不到rts。 當我修改命令以排除rts時,它改為輸出以下內容:

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.

運行cabal update無濟於事,並且將〜/ .cabal / config文件更改為包含user-install: False也不執行任何操作。

我解決了這個問題。 事實證明,問題出在我通過pacman獲得的GHC軟件包(我正在使用arch linux)。 這里的問題是,每當GHC嘗試鏈接到任何庫時,它都會靜態鏈接。 但是,用於GHC的pacman軟件包不包含任何所需的靜態庫。 為了解決該問題,我必須安裝一個名為ghc-static的單獨軟件包,其中包括所有靜態庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM