Haskell、GHC、win32、开罗
我在 Windows 上使用 ghci+cairo 时遇到问题。当我尝试加载时,例如像这样的“ghci -package cairo”,它会失败并出现以下错误:
Loading package random-1.0.0.2 ... linking ... done. Loading package haskell98 ... linking ... done. Loading package syb-0.1.0.2 ... linking ... done. Loading package base-3.0.3.2 ... linking ... done. Loading package mtl-1.1.0.2 ... linking ... done. : C:\Users\alexeys\AppData\Roaming\cabal\cairo-0.12.0\ghc-6.12.3\HScairo-0.12.0.o: unknown symbol `_cairo_surface_destroy' Loading package cairo-0.12.0 ... linking ... : unable to load package `cairo-0.12.0'
即使是最简单的程序也无法在交互模式下工作,例如 cairo 包附带的“Text.hs”。然而,使用“ghc --make”编译一切都按预期工作,因此它不是“缺少 dll”问题 - 一切都已就位。
我使用“filemon”查看“ghci”加载的内容,在日志中我可以看到“libcairo-2.dll”(并且该库定义了“_cairo_surface_destroy”符号)已成功找到并加载,所以我不太明白-它还想要什么?
I have problem with ghci+cairo on windows. When I try to load, for example like this "ghci -package cairo" it fails with the following error:
Loading package random-1.0.0.2 ... linking ... done. Loading package haskell98 ... linking ... done. Loading package syb-0.1.0.2 ... linking ... done. Loading package base-3.0.3.2 ... linking ... done. Loading package mtl-1.1.0.2 ... linking ... done. : C:\Users\alexeys\AppData\Roaming\cabal\cairo-0.12.0\ghc-6.12.3\HScairo-0.12.0.o: unknown symbol `_cairo_surface_destroy' Loading package cairo-0.12.0 ... linking ... : unable to load package `cairo-0.12.0'
Even simplest programs don't work in interactive mode, like for example 'Text.hs' that comes with cairo package. However compiled with 'ghc --make' everything works as expected, so its not a "missing dll" problem - everything is in place.
I used 'filemon' to look what "ghci" loads and in the log I can see 'libcairo-2.dll' (and this library has '_cairo_surface_destroy' symbol defined) being found and loaded successfully, so I don't really understand - what more does it wants?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我怀疑您遇到了我刚刚遇到的许多问题。
我最近尝试在 Windows 上使用 Haskell 和 ZeroMQ 做一些事情。 GHC 在 Windows 上运行,ZeroMQ 有一个 MingW32 端口,并且有一个标准的 ZeroMQ Cabal 包,所以我认为这可以工作。
然而:
libzmq
的静态版本。.dll
,而不是.a
静态存档。我无法将所有部分组合在一起,因此我的 Windows 机器上没有基于 Haskell 的 ZeroMQ 编码。
I suspect you're running into many of the issues I just did.
I tried to do something recently with Haskell and ZeroMQ on windows. GHC runs on Windows, and ZeroMQ has a MingW32 port, and there is a standard ZeroMQ Cabal package, so I thought this would work.
However:
libzmq
..dll
in their MingW32 port, not a.a
static archive.I could not make all the pieces fit together, so no Haskell-based ZeroMQ coding on my windows box.
请运行 ghc-pkg 检查是否一致
Please run ghc-pkg check to see if it is consistent