我尝试安装cabal-doctest-1,但是我收到了这样的编译错误:
Resolving dependencies...
Configuring cabal-doctest-1.0.1...
Building cabal-doctest-1.0.1...
Failed to install cabal-doctest-1.0.1
Build log ( C:\Users\Podlovics Péter\AppData\Roaming\cabal\logs\cabal-doctest-1.0.1.log ):
Building cabal-doctest-1.0.1...
Preprocessing library cabal-doctest-1.0.1...
[1 of 1] Compiling Distribution.Extra.Doctest ( src\Distribution\Extra\Doctest.hs, dist\build\Distribution\Extra\Doctest.o )
src\Distribution\Extra\Doctest.hs:174:70: error:
* Could not deduce (Data.String.IsString
Distribution.Types.UnqualComponentName.UnqualComponentName)
arising from a use of `fromString'
from the context: GHC.Stack.Types.HasCallStack
bound by a type expected by the context:
GHC.Stack.Types.HasCallStack =>
Library -> ComponentLocalBuildInfo -> IO ()
at src\Distribution\Extra\Doctest.hs:(147,3)-(197,9)
or from: GHC.Stack.Types.HasCallStack
bound by a type expected by the context:
GHC.Stack.Types.HasCallStack =>
TestSuite -> ComponentLocalBuildInfo -> IO ()
at src\Distribution\Extra\Doctest.hs:(174,5)-(197,9)
* In the second argument of `(==)', namely
`fromString testSuiteName'
In the first argument of `when', namely
`(testName suite == fromString testSuiteName)'
In the expression:
when (testName suite == fromString testSuiteName)
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
cabal-doctest-1.0.1 failed during the building phase. The exception was:
ExitFailure 1
我尝试将FlexibleContexts硬编码到.hs文件中,但它没有帮助。我有Cabal 1.24。
编辑:
我更新到GHC 8.0.2,安装了cabal-doctest-1,但是lnker似乎没有找到它。此外,我无法将DocTest导入任何模块(您可以在下面找到搜索到的位置)。这是链接器错误:
C:\cabal\cabal-master>cabal install distributive-0.5.2
Resolving dependencies...
Configuring distributive-0.5.2...
Failed to install distributive-0.5.2
Build log ( C:\Users\Podlovics Péter\AppData\Roaming\cabal\logs\distributive-0.5.2.log ):
cabal: Entering directory 'C:\Users\PODLOV~1\AppData\Local\Temp\cabal-tmp-13372\distributive-0.5.2'
cabal: Leaving directory 'C:\Users\PODLOV~1\AppData\Local\Temp\cabal-tmp-13372\distributive-0.5.2'
cabal: Error: some packages failed to install:
distributive-0.5.2 failed during the configure step. The exception was:
user error ('C:\Program Files\Haskell Platform\8.0.2\bin\ghc.exe' exited with
an error:
C:/Program Files/Haskell Platform/8.0.2/mingw/bin/ld.exe: cannot find
-lHScabal-doctest-1-3OH6xMXYfakDTTZ99VQuTb
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
)
这里是位置列表:
Failed to load interface for `DocTest'
Locations searched:
DocTest.hs
DocTest.lhs
DocTest.hsig
DocTest.lhsig
提前致谢