1

我总是收到找不到 sdl2.dll 的错误。我在安装 lispbuilder-sdl 之前尝试安装 cffi,并且 cffi 已成功安装,但 sdl 总是失败并出现这样的错误,有人可以帮忙吗?

    [package json]....................................
[package json-rpc]................................
[package cl-ppcre]................................
..................................................
[package autowrap]................................
[package autowrap.minimal]........................
..................................................
[package plus-c]..................................
[package bordeaux-threads]........................
[package com.metabang.trivial-timeout]............
[package trivial-channels.queue]..................
[package trivial-channels]........................
[package sdl2-ffi]................................
[package sdl2-ffi.accessors]......................
[package sdl2-ffi.functions]......................
[package sdl2]....................................
[package sdl2-examples]
debugger invoked on a CFFI:LOAD-FOREIGN-LIBRARY-ERROR in thread
#<THREAD "main thread" RUNNING {10029A49E3}>:
  Unable to load foreign library (LIBSDL2).
  Error opening shared object "SDL2.dll":
 The specified module could not be found.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Try loading the foreign library again.
  1: [USE-VALUE                    ] Use another library instead.
  2: [TRY-RECOMPILING              ] Recompile library and try loading it again
  3: [RETRY                        ] Retry
                                     loading FASL for #<CL-SOURCE-FILE "sdl2" "library">.
  4: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "sdl2" "library">
                                     as having been successful.
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  7: [ABORT                        ] Give up on "sdl2"
  8:                                 Exit debugger, returning to top level.
4

1 回答 1

2

Sketch 是一个使用 sdl2 和 opengl 的通用 lisp 库,它建议在 Windows 上使用它

图书馆

从 libsdl 网页下载 SDL2、SDL2_IMAGE 和 SDL2_TTF dll 并将它们复制到 Windows 可以找到它们的位置 - \Windows\System32 可以工作。复制 SDL2_TTF 时,请确保复制存档中提供的所有 dll,而不仅仅是 TTF 的。

现在您需要获取一个 libffi dll。执行此操作的方法之一是从源代码编译,但要获得快速简便的解决方案,您只需找到受信任的源并使用其版本即可。例如,如果您在 Windows 上使用 Emacs,您可以在 emacs\bin 中找到 libffi-6.dll。将其复制到您之前将 sdl2 dll 复制到的同一目录中。

cepl也是一个不错的库

并有以下建议:

https://github.com/cbaggers/cepl/blob/master/README.md#windows-c-library-hack

如果您在加载 c 库时遇到问题并且只需要排除 lisp 是否可以找到它们,请尝试将它们放在与 lisp exe 相同的文件夹中。例如 C:\Program Files\sbcl。

于 2016-06-02T07:26:36.040 回答