我有 Windows 10
我安装了 Haskell Platform 8.2.1(来自https://www.haskell.org/platform/windows.html的 HaskellPlatform-8.2.1-full-x86_64-setup.exe )(这个版本有 mingw 和 gcc 6.2.0这很重要)
我从https://sourceforge.net/projects/wxhaskell/files/wxInstall/下载了 Achelane
我将它解压缩到一个没有空格的路径中(如果路径有空格,一个错误会阻止它编译)。
我给了 cabal 更新并更新了配置行 extra-prog-path: 和 extra-lib-dirs
我调用了 Install.bat 但在安装 wxdirect 时出现错误:
cabal: The directory "wxdirect-0.92.3.0\" already exists, not unpacking.
Resolving dependencies...
Configuring wxdirect-0.92.3.0...
Building wxdirect-0.92.3.0...
Failed to install wxdirect-0.92.3.0
Build log ( C:\Users\agranero\AppData\Roaming\cabal\logs\ghc-8.2.1\wxdirect-0.92.3.0-LWW4KzdSYghFJi8qk6ENNl.log ):
Preprocessing executable 'wxdirect' for wxdirect-0.92.3.0..
Building executable 'wxdirect' for wxdirect-0.92.3.0..
[ 2 of 12] Compiling IOExtra ( src\IOExtra.hs, dist\build\wxdirect\wxdirect-tmp\IOExtra.o )
src\IOExtra.hs:16:1: error:
Could not find module `System.IO.Strict'
There are files missing in the `strict-0.3.2' package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.
|
16 | import qualified System.IO.Strict as Strictly
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Leaving directory '.\wxdirect-0.92.3.0'
cabal: Error: some packages failed to install:
wxdirect-0.92.3.0-LWW4KzdSYghFJi8qk6ENNl failed during the building phase. The
exception was:
ExitFailure 1
O sistema não pode encontrar o arquivo especificado.
Could not install wxHaskell
消息“O sistema não pode encontrar o arquivo especificado”。意思是“系统找不到指定的文件”。因为我的巴西葡萄牙语版本的 Windows。
如果我关注https://wiki.haskell.org/WxHaskell/Windows#From_GitHub并尝试从 github 安装,我会得到同样的错误。cabal 安装 wx 的同上。
我之前进行了几次尝试,但我获得了更多的领先优势,但我将 Haskell 安装擦干净,现在我陷入了这个错误。
如果我不更改 cabal 配置文件,我也会得到同样的错误,所以我认为它不相关(此时尚未)。
更新:我设法走得更远,但又被卡住了:我给了 ghc-pkg 检查该消息建议给出大量警告。但总结是:
The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
Cabal-1.24.2.0
process-1.4.3.0
directory-1.3.1.5
time-1.8.0.3
Win32-2.3.1.1
strict-0.3.2
在此之前,我会遇到大量警告:
There are problems in package strict-0.3.2:
Warning: library-dirs: C:\Users\agranero\AppData\Roaming\cabal\x86_64-windows-ghc-8.2.1\strict-0.3.2-7ZEebv7EabCEjNWrS66TpZ
doesn't exist or isn't a directory
按照顺序(在每次 Install.bat 运行时它会警告下一个库),每次我更高级时,我都使用 cabal install lib --reinstall --force-reinstalls 重新安装了所有这些库。
之后我再次运行 Install.bat 并得到:
Unpacking to wxdirect-0.92.3.0\
Resolving dependencies...
In order, the following will be installed:
wxdirect-0.92.3.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring wxdirect-0.92.3.0...
Building wxdirect-0.92.3.0...
Installed wxdirect-0.92.3.0
1 arquivo(s) copiado(s).
Unpacking to wxc-0.92.3.0\
Resolving dependencies...
Configuring wxc-0.92.3.0...
Building wxc-0.92.3.0...
Installed wxc-0.92.3.0
1 arquivo(s) copiado(s).
Resolving dependencies...
Downloading wxcore-0.92.3.0...
Configuring wxcore-0.92.3.0...
Building wxcore-0.92.3.0...
Failed to install wxcore-0.92.3.0
Build log ( C:\Users\agranero\AppData\Roaming\cabal\logs\ghc-8.2.1\wxcore-0.92.3.0-Kq7hfMBPtCHIxCJN1O04PM.log ):
Building wxcore-0.92.3.0...
Preprocessing library wxcore-0.92.3.0...
[ 1 of 23] Compiling Graphics.UI.WXCore.GHCiSupport ( src\haskell\Graphics\UI\WXCore\GHCiSupport.hs, dist\build\Graphics\UI\WXCore\GHCiSupport.o )
[ 2 of 23] Compiling Graphics.UI.WXCore.WxcDefs ( src\haskell\Graphics\UI\WXCore\WxcDefs.hs, dist\build\Graphics\UI\WXCore\WxcDefs.o )
[ 3 of 23] Compiling Graphics.UI.WXCore.WxcObject ( src\haskell\Graphics\UI\WXCore\WxcObject.hs, dist\build\Graphics\UI\WXCore\WxcObject.o )
[ 4 of 23] Compiling Graphics.UI.WXCore.WxcClassTypes ( src\haskell\Graphics\UI\WXCore\WxcClassTypes.hs, dist\build\Graphics\UI\WXCore\WxcClassTypes.o )
[ 5 of 23] Compiling Graphics.UI.WXCore.WxcTypes ( src\haskell\Graphics\UI\WXCore\WxcTypes.hs, dist\build\Graphics\UI\WXCore\WxcTypes.o )
src\haskell\Graphics\UI\WXCore\WxcTypes.hs:752:20: error:
Ambiguous occurrence `CBool'
It could refer to either `Foreign.C.CBool',
imported from `Foreign.C' at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:126:1-16
(and originally defined in `Foreign.C.Types')
or `Graphics.UI.WXCore.WxcTypes.CBool',
defined at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:750:1
|
752 | toCBool :: Bool -> CBool
| ^^^^^
src\haskell\Graphics\UI\WXCore\WxcTypes.hs:755:22: error:
Ambiguous occurrence `CBool'
It could refer to either `Foreign.C.CBool',
imported from `Foreign.C' at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:126:1-16
(and originally defined in `Foreign.C.Types')
or `Graphics.UI.WXCore.WxcTypes.CBool',
defined at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:750:1
|
755 | withBoolResult :: IO CBool -> IO Bool
| ^^^^^
src\haskell\Graphics\UI\WXCore\WxcTypes.hs:760:14: error:
Ambiguous occurrence `CBool'
It could refer to either `Foreign.C.CBool',
imported from `Foreign.C' at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:126:1-16
(and originally defined in `Foreign.C.Types')
or `Graphics.UI.WXCore.WxcTypes.CBool',
defined at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:750:1
|
760 | fromCBool :: CBool -> Bool
| ^^^^^
src\haskell\Graphics\UI\WXCore\WxcTypes.hs:763:55: error:
Ambiguous occurrence `CBool'
It could refer to either `Foreign.C.CBool',
imported from `Foreign.C' at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:126:1-16
(and originally defined in `Foreign.C.Types')
or `Graphics.UI.WXCore.WxcTypes.CBool',
defined at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:750:1
|
763 | foreign import ccall "intToBool" intToCBool :: Int -> CBool
| ^^^^^
src\haskell\Graphics\UI\WXCore\WxcTypes.hs:764:48: error:
Ambiguous occurrence `CBool'
It could refer to either `Foreign.C.CBool',
imported from `Foreign.C' at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:126:1-16
(and originally defined in `Foreign.C.Types')
or `Graphics.UI.WXCore.WxcTypes.CBool',
defined at src\haskell\Graphics\UI\WXCore\WxcTypes.hs:750:1
|
764 | foreign import ccall "boolToInt" cboolToInt :: CBool -> Int
| ^^^^^
cabal: Leaving directory 'C:\Users\agranero\AppData\Local\Temp\cabal-tmp-4404\wxcore-0.92.3.0'
cabal: Error: some packages failed to install:
wx-0.92.3.0-AFrVUsv18GZGvCmfR0yEpQ depends on wx-0.92.3.0 which failed to
install.
wxcore-0.92.3.0-Kq7hfMBPtCHIxCJN1O04PM failed during the building phase. The
exception was:
ExitFailure 1
Could not install wxHaskell
现在我完全迷失了。在http://haskell.1045720.n5.nabble.com/GHC-14418-Compile-errors-wxcore-0-92-3-0-td5866957.html和https://ghc上有此错误的报告 .haskell.org/trac/ghc/ticket/14418 但它已被关闭,因为它不是编译器的错误,而是 wxHaskell 的错误(我同意)。