Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

haskell - How do I get text-icu working on Windows?

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?

question from:https://stackoverflow.com/questions/16127710/how-do-i-get-text-icu-working-on-windows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...