1

I always receive an Error that sdl2.dll can't be found. I've tried to install cffi before installing lispbuilder-sdl, and cffi was installed succesfully but sdl always fail with such an Error, can anyone help?

    [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 Answers1

2

Sketch is a library for common lisp using sdl2 and opengl it has suggestion to work with this on windows

Libraries

Download SDL2, SDL2_IMAGE and SDL2_TTF dlls from libsdl webpage and copy them somewhere Windows can find them - \Windows\System32 will work. When copying SDL2_TTF, make sure to copy all of the dlls provided in the archive, and not just the TTF one.

Now you will need to get a libffi dll. One of the ways of doing this is compiling from the source, but for a quick and easy solution, you can just find a trusted source and use their version. For example, if you are using Emacs on Windows, you can find libffi-6.dll in emacs\bin. Copy it to the same directory you copied sdl2 dlls to earlier.

Also a good library is cepl

and has the following recommendation:

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

If you are having issues getting the c libraries to load and just need to rule out whether lisp can find them, try putting them in the same folder as the lisp exe. For example C:\Program Files\sbcl.

anquegi
  • 11,125
  • 4
  • 51
  • 67