我正在嘗試安裝 FunGEn cabal install --allow-newer=all FunGEn
(我添加了--allow-newer=all
bcs,它遇到了依賴問題)。經過幾次嘗試運行后,我不斷收到相同的錯誤訊息:
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
- text-1.2.3.2 (lib) (requires build)
- OpenGLRaw-3.3.4.1 (lib) (requires build)
- GLURaw-2.0.0.5 (lib) (requires build)
- OpenGL-3.0.3.0 (lib) (requires build)
- GLUT-2.7.0.16 (lib) (requires build)
- FunGEn-1.1.1 (lib) (requires build)
- FunGEn-1.1.1 (exe:fungen-worms) (requires build)
- FunGEn-1.1.1 (exe:fungen-hello) (requires build)
- FunGEn-1.1.1 (exe:fungen-pong) (requires build)
Starting text-1.2.3.2 (lib)
Building text-1.2.3.2 (lib)
Failed to build text-1.2.3.2.
Build log (
C:\cabal\logs\ghc-9.2.1\text-1.2.3.2-69443a9a6ed6dc92878e4d67ead16d149c2e752e.log
):
Preprocessing library for text-1.2.3.2..
Building library for text-1.2.3.2..
[ 1 of 44] Compiling Data.Text.Encoding.Error ( Data\Text\Encoding\Error.hs, dist\build\Data\Text\Encoding\Error.o )
[ 2 of 44] Compiling Data.Text.Internal.Builder.Int.Digits ( Data\Text\Internal\Builder\Int\Digits.hs, dist\build\Data\Text\Internal\Builder\Int\Digits.o )
[ 3 of 44] Compiling Data.Text.Internal.Builder.RealFloat.Functions ( Data\Text\Internal\Builder\RealFloat\Functions.hs, dist\build\Data\Text\Internal\Builder\RealFloat\Functions.o )
[ 4 of 44] Compiling Data.Text.Internal.Encoding.Utf16 ( Data\Text\Internal\Encoding\Utf16.hs, dist\build\Data\Text\Internal\Encoding\Utf16.o )
Data\Text\Internal\Encoding\Utf16.hs:32:23: error:
* Couldn't match expected type `Word#' with actual type `Word16#'
* In the first argument of `word2Int#', namely `a#'
In the expression: word2Int# a#
In an equation for `x#': !x# = word2Int# a#
|
32 | !x# = word2Int# a#
| ^^
Data\Text\Internal\Encoding\Utf16.hs:33:23: error:
* Couldn't match expected type `Word#' with actual type `Word16#'
* In the first argument of `word2Int#', namely `b#'
In the expression: word2Int# b#
In an equation for `y#': !y# = word2Int# b#
|
33 | !y# = word2Int# b#
| ^^
cabal.exe: Failed to build text-1.2.3.2 (which is required by exe:fungen-worms
from FunGEn-1.1.1, exe:fungen-hello from FunGEn-1.1.1 and others). See the
build log above for details.
有人可以解釋這里出了什么問題,以及可能如何解決嗎?謝謝你!
uj5u.com熱心網友回復:
這些特定錯誤來自使用 GHC 9.2 編譯與 GHC 9.2 不兼容的代碼。您嘗試使用的軟體包可以與 GHC 9.0(--allow-newer
不需要)一起編譯,我建議您使用。如今,使用GHCup在編譯器版本之間切換非常容易。
另一個不需要切換編譯器的選項是,正如您所做的那樣,以--alow-newer
某種方式應用。你應該明白,它是一種非常危險的武器,只有在你了解依賴解決的作業原理,并且有足夠的經驗和cabal
一般情況下才能更好地使用它。對我有用的變體:
cabal update
cabal install --allow-newer=bytestring FunGEn
您的方法中另一個可能的問題是cabal install
(沒有適當的開關)只會在包中為您提供可執行檔案,而不是在庫中。沒關系,如果那是你想要的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/487895.html