I was able to cabal install text-icu without errors. (I used --extra-lib-dirs and --extra-include-dirs to point to the lib and include directories in the binary distribution of icu4c.)
I was also able to build the following simple program that uses text-icu, by doing ghc --make icu.hs:
-- icu.hs import Data.Text.ICU main = print $ Locale "tr-TR" No errors or warnings in either of these steps. But when I try to run the compiled program, icu.exe, I get no output at all. I expected to get a line with Locale "tr-TR", but instead I get nothing -- not even an error or warning. This remains the case if I try
main = do print $ Locale "tr-TR" print "Done" so using the text-icu stuff seems to cause the program to silently fail. echo $? yields False.
Does anyone have text-icu up and running on Windows? Can you tell me what I'm doing wrong?
Stack includes a copy of msys2 on Windows, which contains the pacman package manager, so we can run:
stack exec -- pacman -Sy mingw64/mingw-w64-x86_64-icu stack build text-icu
I managed it by doing:
icu/bin into the directory C:\bin which is on my %PATH%. Extract the contents of icu into the directory C:\bin\icu.stack ghci text-icu --extra-lib-dirs=c:\bin --extra-include-dirs=c:\bin\icu\include.import Data.Text.ICU.Normalize, then :set -XOverloadedStrings, then normalize None "test".icuuc.dll, take the C:\bin\icuuc56.dll and make a copy at C:\bin\icuuc.dll. For me, there were three relevant dlls.After all that, I can normalise a string in ghci.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With