运行 wxHaskell 时出现问题(Windows)

发布于 2024-11-24 01:28:43 字数 1950 浏览 0 评论 0原文

该页面:(http://en.wikibooks.org/wiki/Haskell/GUI)描述了要运行wx代码,可以安装wx,然后必须“用GHC注册wxHaskell” - 但我认为wxHaskell的二进制安装程序(http://wxhaskell.sourceforge.net/download.html)会自动执行吗?

我安装了 wx-config,然后是 wxPack 和 wxHaskell。然后进行了 wx 和 wxcore 的 cabal 安装。我正在运行 Leksah 的一些 wx 演示,看起来大部分都不错 - 但它们有一些奇怪的错误(我找到了一个所谓的解决方案:“wxhaskell-labels-cant-display-full-text”),但我想尝试一些来自 GHCi 的东西。

我尝试运行他们的简单演示,并出现错误:

D:\csPlangs\Haskell\play>ghci -package wx wxGui1.hs
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.2 ... linking ... done.
Loading package stm-2.2.0.1 ... linking ... done.
Loading package bytestring-0.9.1.10 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package Win32-2.2.0.1 ... linking ... done.
Loading package filepath-1.2.0.0 ... linking ... done.
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package old-time-1.0.0.6 ... linking ... done.
Loading package directory-1.1.0.0 ... linking ... done.
Loading package transformers-0.2.2.0 ... linking ... done.
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package parsec-3.1.1 ... linking ... done.
Loading package time-1.2.0.3 ... linking ... done.
Loading package wxdirect-0.12.1.4 ... linking ... done.
Loading package wxcore-0.12.1.7 ... ghc.exe: stdc++: The specified module could
not be found.
<command line>: can't load .so/.DLL for: stdc++ (addDLL: could not load DLL)

还有[有趣的]错误:

*Main> q

<interactive>:1:1: Not in scope: `q'
*Main>
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.0.3 for i386-unknown-mingw32):
        thread blocked indefinitely in an MVar operation

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

The page: (http://en.wikibooks.org/wiki/Haskell/GUI) describes that to run wx code, one can install wx and then one must "register wxHaskell with GHC" - but I think the binary installer of wxHaskell (http://wxhaskell.sourceforge.net/download.html) does that automatically?

I installed wx-config, and then wxPack, and wxHaskell. and then did cabal install of wx and wxcore. I am running some wx demos from Leksah, which seem mostly good - but they had some weird errors (I found an alleged solution to that: "wxhaskell-labels-cant-display-full-text"), but I wanted to try some things just from GHCi.

I try to run their simple demos, and the the errors:

D:\csPlangs\Haskell\play>ghci -package wx wxGui1.hs
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.2 ... linking ... done.
Loading package stm-2.2.0.1 ... linking ... done.
Loading package bytestring-0.9.1.10 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package Win32-2.2.0.1 ... linking ... done.
Loading package filepath-1.2.0.0 ... linking ... done.
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package old-time-1.0.0.6 ... linking ... done.
Loading package directory-1.1.0.0 ... linking ... done.
Loading package transformers-0.2.2.0 ... linking ... done.
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package parsec-3.1.1 ... linking ... done.
Loading package time-1.2.0.3 ... linking ... done.
Loading package wxdirect-0.12.1.4 ... linking ... done.
Loading package wxcore-0.12.1.7 ... ghc.exe: stdc++: The specified module could
not be found.
<command line>: can't load .so/.DLL for: stdc++ (addDLL: could not load DLL)

And also the [interesting] error:

*Main> q

<interactive>:1:1: Not in scope: `q'
*Main>
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.0.3 for i386-unknown-mingw32):
        thread blocked indefinitely in an MVar operation

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

○愚か者の日 2024-12-01 01:28:43

这似乎是 wxHaskell、GHCi 和 Windows 组合的一个已知问题。来自 http://www.haskell.org/haskellwiki/WxHaskell/Quick_start

在 Windows 7 上,ghci 会抱怨“无法加载 .so/.DLL for: std c++ ...”。但是 ghc --make Hello.hs; Hello.exe 在命令行上运行良好。

所以,你可以编译你的代码。你只是无法通过解释器运行它。

It appears to be a known problem with the combination of wxHaskell, GHCi, and Windows. From http://www.haskell.org/haskellwiki/WxHaskell/Quick_start

On Windows 7, ghci will complain "can't load .so/.DLL for: std c++ ...". But ghc --make Hello.hs; Hello.exe on the command line works well.

So, you can compile your code. You just can't run it through the interpreter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文