问题描述
我能够正确安装 text-icu
.(我使用-extra-lib-dirs
和-extra-include-dirs
指向 lib
和 include
icu4c的二进制发行版中的目录.)
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.)
通过执行 ghc --make icu.hs
,我还能够构建以下使用 text-icu
的简单程序:
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"
这两个步骤中没有错误或警告.但是,当我尝试运行编译后的程序 icu.exe
时,根本没有输出.我期望得到与 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"
因此使用 text-icu
东西似乎会导致程序无提示地失败. echo $?
产生 False
.
so using the text-icu
stuff seems to cause the program to silently fail. echo $?
yields False
.
有人在Windows上启动并运行 text-icu
吗?你能告诉我我在做什么错吗?
Does anyone have text-icu
up and running on Windows? Can you tell me what I'm doing wrong?
推荐答案
Stack 包含msys2的副本在Windows中,其中包含 pacman
程序包管理器,因此我们可以运行:
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
这篇关于如何在Windows上使用text-icu?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!