Install wxHaskell 64 on Windows 10 get error (foreign import ccall "boolToInt" cboolToInt :: CBool -> Int). What to do?

336 Views Asked by At

I have Windows 10

I installed Haskell Platform 8.2.1 (HaskellPlatform-8.2.1-full-x86_64-setup.exe from https://www.haskell.org/platform/windows.html) (This version have mingw and gcc 6.2.0 for what this matters)

I downloaded Achelane from https://sourceforge.net/projects/wxhaskell/files/wxInstall/

I unzipped it in a path without spaces (a bug prevents it from compiling if path has spaces).

I gave cabal update and updated the config lines extra-prog-path: and extra-lib-dirs

I called Install.bat but when installing wxdirect I get the error:

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

The message "O sistema não pode encontrar o arquivo especificado." means "System cannot find specified file." because of my Brazilian Portuguese version of Windows.

If I follow https://wiki.haskell.org/WxHaskell/Windows#From_GitHub and try to install from github I get the same error. Idem for cabal install wx.

I had several previous attempts where I get a little more ahead but I wiped my Haskell install clean and now I am stuck on this error.

If I do not change cabal config file I get the same error too, so I thing it is not relevant (at this point yet).

UPDATE: I managed to go further, but got stuck again: I gave the ghc-pkg check that the message suggest gives a huge amount of warnings. But the summary is:

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

Before that I get in the middle of the huge amount of warnings this:

    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 

Following the sequence (as at each Install.bat run It warned of the next lib) I reinstalled all those libs with cabal install lib --reinstall --force-reinstalls each time I advanced more.

After that I run Install.bat again and I got:

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

Now I am completely lost. There is a report of this error on http://haskell.1045720.n5.nabble.com/GHC-14418-Compile-errors-wxcore-0-92-3-0-td5866957.html and on https://ghc.haskell.org/trac/ghc/ticket/14418 but it was closed as not being a bug of the compiler but of wxHaskell (which I agree with).

0

There are 0 best solutions below