lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
309 stars 82 forks source link

Unknown field :window on macOS with CCL 1.11 #101

Closed s-clerc closed 7 years ago

s-clerc commented 7 years ago

I tried to run it using CCL64 v1.11-r16635 with SDL2 installed and I recieve the following error:

 Error: Unknown field :WINDOW for foreign-record type:
>        #<FOREIGN-RECORD ANON-TYPE-7768 #x302001A7FDCD>
>        Valid fields:
>          :HDC (SDL2-FFI:HDC)
>        
> While executing: #<STANDARD-METHOD PLUS-C::BUILD-REF (SYMBOL AUTOWRAP:FOREIGN-RECORD T T)>, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

macOS version: 10.12.6

s-clerc commented 7 years ago

I tried it in CCL32 and it fails to even locate the installation of SDL.

cbaggers commented 7 years ago

Hi there @Swissnetizen thanks for the report. Not many of the maintainers here has Macs sadly but I will try have a peek at this at the weekend.

Unusual to see an unknown field though, possibling a version mismatch. How did you install SDL2 and which version is it?

s-clerc commented 7 years ago

I installed it using home brew and it’s version 2.0.7. It’s installed into /usr/local/Cellar/sdl2/2.0.7

Thanks for having a look !

s-clerc commented 7 years ago

I had a go at running it in SBCL:

; file: ~/quicklisp/dists/quicklisp/software/cl-sdl2-20170227-git/src/syswm.lisp
; in: DEFUN GET-WINDOW-WM-INFO
;     (SDL2::INFO :INFO :WIN :WINDOW)
; ==>
;   (PLUS-C:C-REF #:TMP0 SDL2-FFI:SDL-SYSWM-INFO :INFO :WIN :WINDOW)
; 
; caught ERROR:
;   during macroexpansion of (C-REF #:TMP0 SDL2-FFI:SDL-SYSWM-INFO ...). Use
;   *BREAK-ON-SIGNALS* to intercept.
;   
;    Unknown field :WINDOW for foreign-record type:
;   #<AUTOWRAP:FOREIGN-RECORD ANON-TYPE-593 {1006057323}>
;   Valid fields:
;     :HDC (SDL2-FFI:HDC)

Then I set *break-on-signals* and redid what I did:

debugger invoked on a SIMPLE-CONDITION in thread
#<THREAD "main thread" RUNNING {1001BBEB73}>:
  compiling #<STATIC-FILE "uiop" "contrib/debug.lisp"> completed without its input file #P"~/quicklisp/dists/quicklisp/software/uiop-3.2.0/contrib/debug.lisp"
BREAK was entered because of *BREAK-ON-SIGNALS* (now rebound to NIL).

I also had a go at running it in an XQuartz terminal window, since it helped with CLX, but no dice.

rpav commented 7 years ago

This should have been fixed in 7573f7f444eb3c25e08013733b9bdef90e8473b7, have you tried updating? Or has that not made it into Quicklisp yet?

Alternatively your *features* is broken and either don't include :DARWIN or does include :WINDOWS or something.

s-clerc commented 7 years ago

You’re right ! I checked before and the wmsym source didn’t match. I just assumed (due to my lack of experience in lisp) that #+ signified platform specific code and QL automatically removes it.

Anyway I’ve tried reinstalling, but the code is the same. I’ll have a go at replacing it with github code in a bit.

s-clerc commented 7 years ago

Yeah that did it! Thanks!

cbaggers commented 7 years ago

thanks @rpav