Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load sdl-gfx in quicklisp

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?

like image 397
walkmansk Avatar asked Dec 22 '25 05:12

walkmansk


1 Answers

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))))
like image 143
Rob Blackwell Avatar answered Dec 24 '25 11:12

Rob Blackwell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!