Windows runtime linker failure with icuuc
First, install mingw-w64-x86_64-icu
(I'm using version 58.2-2):
$ pacman -S mingw-w64-x86_64-icu
Now take this file:
module Main where
import Data.Int
import Foreign
import Foreign.C.String
import Foreign.C.Types
type UErrorCode = CInt
u_ZERO_ERROR :: UErrorCode
u_ZERO_ERROR = 0
foreign import ccall "ucnv_open_58"
c_ucnv_open :: CString -> Ptr UErrorCode -> IO (Ptr ())
foreign import ccall "ucnv_getMaxCharSize_58"
c_ucnv_getMaxCharSize :: Ptr () -> IO Int8
main :: IO ()
main = with u_ZERO_ERROR $ \status -> do
conv <- c_ucnv_open nullPtr status
c_ucnv_getMaxCharSize conv >>= print
GHC is able to compile this successfully:
$ ghc -licuuc Bug2.hs
[1 of 1] Compiling Main ( Bug2.hs, Bug2.o )
Linking Bug2.exe ...
$ ./Bug2.exe
1
But GHCi is unable to accomplish the same thing:
$ runghc -licuuc Bug2.hs
ghc.exe: | C:\Users\RyanGlScott\Documents\Hacking\Haskell\Bug2.o: unknown symbol `ucnv_open_58'
Bug2.hs:
Phyx- and I discussed this briefly on IRC. He suspected that the fact that C:\Windows\System32
now contains its own copy of icuuc.dll
is contributing to the issue.