vydd / sketch

A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer graphics, exploration of human-computer interaction, and more.
MIT License
1.4k stars 67 forks source link

Attemps to print text cause errors #50

Closed 4lph4-Ph4un closed 2 years ago

4lph4-Ph4un commented 2 years ago

Trying the hello-world-example yields the following, while other examples seem to work just fine:

The 'ffi_prep_cif' libffi call failed for function "TTF_RenderUTF8_Blended".
   [Condition of type CFFI::SIMPLE-LIBFFI-ERROR]

Restarts:
 0: [CONTINUE] Return to the SDL2 main loop.
 1: [ABORT] Abort, quitting SDL2 entirely.
 2: [ABORT] abort thread (#<THREAD "SDL2 Main Thread" RUNNING {1006605D53}>)

Backtrace:
  0: ((FLET "H0" :IN KIT.SDL2:RENDER) #<CFFI::SIMPLE-LIBFFI-ERROR "The 'ffi_prep_cif' libffi call failed for function ~S." {1007DC13B3}>)
  1: (SB-KERNEL::%SIGNAL #<CFFI::SIMPLE-LIBFFI-ERROR "The 'ffi_prep_cif' libffi call failed for function ~S." {1007DC13B3}>)
  2: (ERROR CFFI::SIMPLE-LIBFFI-ERROR :FUNCTION-NAME "TTF_RenderUTF8_Blended" :FORMAT-CONTROL "The 'ffi_prep_cif' libffi call failed for function ~S." :FORMAT-ARGUMENTS ("TTF_RenderUTF8_Blended"))
  3: (CFFI::LIBFFI-ERROR "TTF_RenderUTF8_Blended" "The 'ffi_prep_cif' libffi call failed for function ~S." "TTF_RenderUTF8_Blended")
  4: (CFFI::MAKE-LIBFFI-CIF "TTF_RenderUTF8_Blended" :POINTER (:POINTER :POINTER (:STRUCT SDL2-TTF::SDL-COLOR)) :DEFAULT-ABI)
  5: (SDL2-TTF::%SDL-RENDER-UTF8-BLENDED #.(SB-SYS:INT-SAP #X00BA7930) "ERROR" (SDL2-TTF::R 255 SDL2-TTF::G 255 SDL2-TTF::B 255 ...))
  6: (SDL2-TTF:RENDER-UTF8-BLENDED #<SDL2-FFI:TTF-FONT {#X00BA7930}> "ERROR" 255 255 255 255)
  7: (SKETCH:TEXT-LINE-IMAGE "ERROR")
      Locals:
        LINE = "ERROR"
  8: (SKETCH:TEXT "ERROR ..)
      Locals:
        FONT = #<SKETCH::FONT {1002CBCDC3}>
        HEIGHT = NIL
        PREVIOUS-PEN = #S(SKETCH:PEN :FILL NIL :STROKE NIL :WEIGHT 1 :CURVE-STEPS 100)
        TEXT-STRING = "ERROR\n---\nThe 'ffi_prep_cif' libffi call failed for function \"TTF_RenderUTF8_Blended\".\n---\nClick for restarts."
        TOP = 0
        WIDTH = NIL
        X = 20
        Y = 20
  9: ((:METHOD KIT.SDL2:RENDER (SKETCH:SKETCH)) #<SKETCH-EXAMPLES:HELLO-WORLD {1007D90313}>) [fast-method]
 10: ((SB-PCL::EMF KIT.SDL2:RENDER) #<unused argument> #<unused argument> #<SKETCH-EXAMPLES:HELLO-WORLD {1007D90313}>)
 11: ((LAMBDA NIL :IN KIT.SDL2:RENDER))
 12: ((SB-PCL::EMF KIT.SDL2:WINDOW-EVENT) #<unused argument> #<unused argument> #<SKETCH-EXAMPLES:HELLO-WORLD {1007D90313}> :EXPOSED 156704 0 0)
 13: (KIT.SDL2::MAIN-LOOP-FUNCTION #<SDL2-FFI:SDL-EVENT {#X02D08C60}> NIL)
 14: (KIT.SDL2::MAIN-LOOP)
 15: ((LAMBDA NIL :IN KIT.SDL2:START))
 16: (SDL2::HANDLE-MESSAGE (#<CLOSURE (LAMBDA NIL :IN KIT.SDL2:START) {1002762DBB}>))
 17: (SDL2::SDL-MAIN-THREAD)
 18: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 19: ((FLET SB-UNIX::BODY :IN SB-TH

It seems I'm generally able to use Sketch, but any attempts at text cause the same error to appear.. I didn't know Sketch was supposed to show that nice red screen with errors because that has failed before with the above error.. :D

Running on Windows.

aykaramba commented 2 years ago

I had to symlink my libffi to whatever is the latest version. For example:

/usr/lib/x86_64-linux-gnu/libffi.so -> libffi.so.7.1.0

4lph4-Ph4un commented 2 years ago

This seems to be a dupe of #38, so closing!