Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Haskell 无法安装线性库_Haskell_Cabal - Fatal编程技术网

Haskell 无法安装线性库

Haskell 无法安装线性库,haskell,cabal,Haskell,Cabal,我在Ubuntu上,这是我一直收到的错误信息。此库是sdl2的依赖项。是否需要安装其他外部库 ghc版本:8.0.2 阴谋集团版本:1.24.2.0 $ cabal install linear Resolving dependencies... Configuring linear-1.21... Building linear-1.21... Failed to install linear-1.21 Build log ( /home/dagon/.cabal/logs/linear-1.

我在Ubuntu上,这是我一直收到的错误信息。此库是sdl2的依赖项。是否需要安装其他外部库

ghc版本:8.0.2 阴谋集团版本:1.24.2.0

$ cabal install linear
Resolving dependencies...
Configuring linear-1.21...
Building linear-1.21...
Failed to install linear-1.21
Build log ( /home/dagon/.cabal/logs/linear-1.21.log ):
cabal: Entering directory '/tmp/cabal-tmp-19434/linear-1.21'
[1 of 1] Compiling Main             ( /tmp/cabal-tmp-19434/linear-1.21/dist/setup/setup.hs, /tmp/cabal-tmp-19434/linear-1.21/dist/setup/Main.o )
Linking /tmp/cabal-tmp-19434/linear-1.21/dist/setup/setup ...
Configuring linear-1.21...
Building linear-1.21...
Preprocessing library linear-1.21...
[ 1 of 22] Compiling Linear.Instances ( src/Linear/Instances.hs, dist/build/Linear/Instances.o )
[ 2 of 22] Compiling Linear.Vector    ( src/Linear/Vector.hs, dist/build/Linear/Vector.o )
[ 3 of 22] Compiling Linear.Epsilon   ( src/Linear/Epsilon.hs, dist/build/Linear/Epsilon.o )
[ 4 of 22] Compiling Linear.Metric    ( src/Linear/Metric.hs, dist/build/Linear/Metric.o )
[ 5 of 22] Compiling Linear.V         ( src/Linear/V.hs, dist/build/Linear/V.o )
[ 6 of 22] Compiling Linear.V0        ( src/Linear/V0.hs, dist/build/Linear/V0.o )

src/Linear/V0.hs:118:26: error:
    • Can't find interface-file declaration for variable Language.Haskell.TH.Lib.conE
        Probable cause: bug in .hi-boot file, or inconsistent .hi file
        Use -ddump-if-trace to get an idea of which file caused the error
    • In the expression:
        Language.Haskell.TH.Lib.conE
          (Language.Haskell.TH.Syntax.mkNameG_d
             "linear-1.21-3KFkhfsxDISEWxZYTrwhrX" "Linear.V0" "V0")
      In an equation for ‘lift’:
          lift V0
            = Language.Haskell.TH.Lib.conE
                (Language.Haskell.TH.Syntax.mkNameG_d
                   "linear-1.21-3KFkhfsxDISEWxZYTrwhrX" "Linear.V0" "V0")
      When typechecking the code for ‘Language.Haskell.TH.Syntax.lift’
        in a derived instance for ‘Lift (V0 a)’:
        To see the code I am typechecking, use -ddump-deriv
      In the instance declaration for ‘Lift (V0 a)’
cabal: Leaving directory '/tmp/cabal-tmp-19434/linear-1.21'
cabal: Error: some packages failed to install:
linear-1.21 failed during the building phase. The exception was:
ExitFailure 1

这可能是你(非常旧)版本的阴谋集团和GHC的问题。请注意使用较新版本时的进度:

% docker run --rm -it haskell bash
... downloading image ...
# ghc --version && cabal --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
cabal-install version 3.0.1.0
compiled using version 3.0.2.0 of the Cabal library
# cabal update && cabal install --lib linear
... lots of download/build/install steps...
Starting     linear-1.21 (all, legacy fallback)
Building     linear-1.21 (all, legacy fallback)
Installing   linear-1.21 (all, legacy fallback)
Completed    linear-1.21 (all, legacy fallback)
# ghci
Prelude> import Linear
Prelude Linear>

您使用的是什么版本的ghc和cabal安装?@Cubic ghc版本:8.0.2 cabal版本:1.24.2.0