3

I've been installing lispbuilder-sdl family with quicklisp and encountered error in sdl-gfx:

CL-USER> (ql:quickload "lispbuilder-sdl-gfx")
To load "lispbuilder-sdl-gfx":                                                  
  Load 1 ASDF system:                                                           
    lispbuilder-sdl-gfx                                                         
; Loading "lispbuilder-sdl-gfx"                                                 
...........;                                                                    
           ; compilation unit aborted                                           
           ;   caught 1 fatal ERROR condition  

Unable to load any of the alternatives:                                         
   ("libSDL_gfx.dylib" (:FRAMEWORK "SDL_gfx"))
   [Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]

I use slime+emacs+SBCL under macosx 10.6. I've installed SDL.framework from this link:

http://thirdcog.eu/apps/frameworks#glew

a file called sdl_with_friends.zip and put things under /Library/Frameworks. However it still complains about cannot find framework. Any idea on this?

genpfault
  • 51,148
  • 11
  • 85
  • 139
walkmansk
  • 53
  • 6

3 Answers3

2

The easiest way to install lispbuilder-sdl on Mac OSX is to fire up SBCL and use Quicklisp:

(ql:quickload "lispbuilder-sdl")

It will probably fail, but you can then compile the OS-X specific helper library located in "~quicklisp/dists/quicklisp/software/lispbuilder-20110619-svn/lispbuilder-sdl/cocoahelper"; just cd to this directory and type "make"

To verify that worked, try this:

(ql:quickload "lispbuilder-sdl-examples")
(lispbuilder-sdl-examples:bezier)

Another common gotcha is when you are using Emacs / SLIME. The cocoa bits must run on the primary thread, so you have to invoke things like this:

#+darwin #+sb-thread
(let ((thread (first (last (sb-thread:list-all-threads)))))
  (sb-thread:interrupt-thread thread #'(lambda () (ql:quickload "lispbuilder-sdl-examples")))
  (sb-thread:interrupt-thread thread #'(lambda () (lispbuilder-sdl-examples:bezier))))
0

using homebrew you can brew install sdl_gfx

Lex
  • 388
  • 2
  • 8
0

The error is complaining that it can't load the dynamic library for SDL. I'm sorry - I don't know much about the directory layout on macs (which appears to be where you're working), so I can't exactly tell you how to fix this. But somewhere you should have installed a file called libSDL_gfx.dylib (probably this extension) and the error message means that CFFI is failing to find it.

Rupert Swarbrick
  • 2,793
  • 16
  • 26
  • Thanks man, I had bypass this problem since libSDL_gfx won't prevent me from running examples from sdl. Somehow the problem remains unsolved. Just leave it here for future review. – walkmansk Jul 19 '11 at 01:44