AlexCharlton / cl-glfw3

Common Lisp bindings to GLFW version 3.x
BSD 2-Clause "Simplified" License
87 stars 31 forks source link

(ql:quickload :cl-glfw3) fails on LispWorks #18

Open e2-71828 opened 7 years ago

e2-71828 commented 7 years ago

I'm running LispWorks Personal Edition 6.1.1 on Windows 10, and quickload is giving me the following error:

CL-USER 2 > (ql:quickload 'cl-glfw3)
To load "cl-glfw3":
  Load 1 ASDF system:
    cl-glfw3
; Loading "cl-glfw3"

Error: Unable to load any of the alternatives:
   ((:DEFAULT "libglfw3") (:DEFAULT "libglfw"))
   1 (continue) Try loading the foreign library again.
   2 Use another library instead.
   3 Try loading C:\Users\e\AppData\Local\cache\common-lisp\lwpe-6.1.1-win-x86\C\Users\e\quicklisp\dists\quicklisp\software\cl-glfw3-20170124-git\glfw-bindings.ofasl again.
   4 Give up loading C:\Users\e\AppData\Local\cache\common-lisp\lwpe-6.1.1-win-x86\C\Users\e\quicklisp\dists\quicklisp\software\cl-glfw3-20170124-git\glfw-bindings.ofasl.
   5 Try loading another file instead of C:\Users\e\AppData\Local\cache\common-lisp\lwpe-6.1.1-win-x86\C\Users\e\quicklisp\dists\quicklisp\software\cl-glfw3-20170124-git\glfw-bindings.ofasl.
   6 Recompile glfw-bindings and try loading it again
   7 Retry loading FASL for
   #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cl-glfw3" "glfw-bindings">.
   8 Continue, treating loading FASL for
   #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cl-glfw3" "glfw-bindings">
     as having been successful.
   9 Retry ASDF operation.
  10 Retry ASDF operation after resetting the configuration.
  11 (abort) Give up on "cl-glfw3"
  12 Return to level 0.
  13 Return to top loop level 0.

Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.

Selecting continuation option 2 is able to correct the problem by specifying glfw's actual Windows filename:

%CL-GLFW3 3 : 1 > :c 2
Enter a new value (unevaluated): ("glfw3.dll")
Creating foreign funcallable for signature (:POINTER :POINTER :POINTER) -> :VOID
Creating foreign funcallable for signature (:POINTER) -> :POINTER
Creating foreign funcallable for signature (:POINTER :POINTER) -> :POINTER
.
Creating foreign funcallable for signature (:INT :POINTER) -> :POINTER

(CL-GLFW3)

At this point, it's at least capable of opening a window and running keyboard handlers; I haven't tried getting the graphics pipeline to work yet.

If you're trying to reproduce the issue, note that LispWorks Personal ships with an ancient version of asdf that has to be upgraded before quicklisp will work. I used the instructions here to do this.

tavurth commented 6 years ago

As you can see here: https://github.com/AlexCharlton/cl-glfw3/blob/543d5f174a4f5c62ab0c516e0635698a19394bbc/glfw-bindings.lisp#L97 We are trying to load the glfw3.dll but your lisp can't find it.

I had a very similar error when using ccl on Mac OSX Sierra.

? (ql:quickload :cl-glfw3)

To load "cl-glfw3":
  Load 1 ASDF system:
    cl-glfw3
; Loading "cl-glfw3"

> Error: Unable to load any of the alternatives:
>           ("libglfw3.1.dylib" "libglfw3.dylib" "libglfw.3.1.dylib" "libglfw.3.dylib")
> While executing: CFFI::FL-ERROR, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

This was solved by using ccl64 rather than ccl.

The dylib seems to be unavailable for the 32bit compiled lisp.