无法运行DrRacket或gracket 7.0

时间:2018-08-05 22:51:52

标签: racket

当我在OSX 10.7.5上open DrRacket.app v7.0时,收到以下错误消息:

LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Racket v7.0/DrRacket.app.

从命令行运行drracket会产生更多详细信息:

ffi-lib: couldn't open "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics.dylib" (dlopen(/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics.dylib, 6): image not found)
  context...:
   "/Applications/Racket v7.0/share/pkgs/gui-lib/mred/private/wx/cocoa/utils.rkt": [running body]
   for-loop
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   do-dynamic-require5
   "/Applications/Racket v7.0/share/pkgs/gui-lib/mred/private/wx/platform.rkt": [running body]
   for-loop
   run-module-instance!125
   ...

关于我应该尝试什么的建议?

我认为问题很可能是我在运行旧版本的OSX。 CoreGraphics在10.8中引入。我一直在寻找有关每个Racket版本需要什么操作系统版本的文档,但还没有发现任何东西。有谁知道它在哪里?

1 个答案:

答案 0 :(得分:0)

马修·弗拉特(Matthew Flatt)亲切回答了我对Racket github的问题。实际上,Racket 7.0中的 DrRacket gracket 确实可以在10.8之前的OSX上运行。让他们工作:

  1. share/pkgs/gui-lib/mred/private/wx/cocoa/utils.rkt的第41行更改为:

    (define cg-lib (ffi-lib (format "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics") #:fail (lambda () #f)))

  2. share/pkgs/gui-lib/mred/private/wx/cocoa/queue.rkt中,更改以下行:

    (define-cg CGEventTapCreate (_fun _uint32 _uint32 _uint32 _uint64 (_fun #:atomic? #t #:keep mb-detect-box _pointer _uint32 _id _pointer -> _id) _pointer -> _pointer))
    至:

    (define-cg CGEventTapCreate (_fun _uint32 _uint32 _uint32 _uint64 (_fun #:atomic? #t #:keep mb-detect-box _pointer _uint32 _id _pointer -> _id) _pointer -> _pointer) #:fail (lambda () #f))

    和这一行:

    (define-cg CGEventGetLocation (_fun _pointer -> _NSPoint))

    至:

    (define-cg CGEventGetLocation (_fun _pointer -> _NSPoint) #:fail (lambda () #f))

这些更改消除了对CoreGraphics的依赖。