【问题标题】:can't get wxHaskell to work from ghci on Mac无法让 wxHaskell 在 Mac 上的 ghci 中工作
【发布时间】:2012-12-27 18:48:52
【问题描述】:

我正在尝试使用EnableGUI function 运行an example

% ghci -framework Carbon Main.hs

*Main> enableGUI >> main

这是我得到的,而不是工作程序:

2013-01-14 00:21:03.021 ghc[13403:1303] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-945.11/Misc.subproj/NSUndoManager.m:328
2013-01-14 00:21:03.022 ghc[13403:1303] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2013-01-14 00:21:03.024 ghc[13403:1303] (
    0   CoreFoundation                      0x00007fff8c8ea0a6 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff867243f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8c8e9ee8 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff884966a2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   Foundation                          0x00007fff884fc8b7 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
    5   AppKit                              0x00007fff8ecb832d -[NSApplication run] + 687
    6   libwx_osx_cocoau_core-2.9.4.0.0.dylib 0x000000010ae64c96 _ZN14wxGUIEventLoop5DoRunEv + 40
    7   libwx_baseu-2.9.4.0.0.dylib         0x000000010b37e0e5 _ZN13wxCFEventLoop3RunEv + 63
    8   libwx_baseu-2.9.4.0.0.dylib         0x000000010b2e91bf _ZN16wxAppConsoleBase8MainLoopEv + 81
    9   libwx_osx_cocoau_core-2.9.4.0.0.dylib 0x000000010ae1b04f _ZN5wxApp5OnRunEv + 29
    10  libwx_baseu-2.9.4.0.0.dylib         0x000000010b32e8d1 _Z7wxEntryRiPPw + 102
    11  libwxc.dylib                        0x000000010bc8a9a4 ELJApp_InitializeC + 116
    12  ???                                 0x000000010beb9702 0x0 + 4494956290
)
2013-01-14 00:21:03.024 ghc[13403:1303] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-945.11/Misc.subproj/NSUndoManager.m:328

当我编译并macosx-app 它时,它运行得相当好,但是,出于显而易见的原因,我真的希望它在 ghci 上运行。

我能做什么?谷歌没有透露与 Haskell 一起使用的 NSUndoManager 的神秘问题。 :(

【问题讨论】:

    标签: haskell wxwidgets macos-carbon nsundomanager wxhaskell


    【解决方案1】:

    ghci -fno-ghci-沙盒

    在 OSX 10.8 上为我工作,wx 0.90.0.1

    感谢海因里希:https://github.com/jodonoghue/wxHaskell/pull/6

    【讨论】:

    • 在 cabal 文件 /(可执行部分)中添加 ghc-options: -fno-ghci-sandbox 在 Leksah / ghci - 调试器中也可以使用。
    • 刚刚尝试并确认ghc-options: -fno-ghci-sandbox 解决了问题。谢谢 Luc Taesch!
    【解决方案2】:

    wxHaskell 已经有一段时间没有在 ghci 中工作了。显然 C++ 内存管理和重用 ghci 中的组件会导致问题。你必须反复重写 main 。 :(

    faq

    GHCi 不能混合使用静态库和动态库;它将在不久的将来在 wxHaskell 中解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-23
      • 1970-01-01
      • 1970-01-01
      • 2015-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多