如何在Windows 10中安装lisp sdl(无法加载外部库(LIBSDL2)。打开共享对象时出错" SDL2.dll" :)

时间:2016-05-31 12:33:08

标签: lisp sdl common-lisp sbcl quicklisp

我总是收到一个无法找到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.

1 个答案:

答案 0 :(得分:1)

Sketch是使用sdl2和opengl的常见lisp库,它有suggestion在Windows上使用它

  

     

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

     

现在你需要获得一个libffi dll。这样做的方法之一   是从源头编译,但为了快速简便的解决方案,你   可以找到一个受信任的来源并使用他们的版本。例如,如果   你在Windows上使用Emacs,你可以在中找到libffi-6.dll   Emacs的\ bin中。将其复制到您复制sdl2 dlls的同一目录   早。

另一个好的库是cepl

并提出以下建议:

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

  

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