Sunday, June 14, 2026

Installing CFFI on SBCL on Windows 11

Installing CFFI on SBCL on Windows 11

Version info:
- OS: Windows 11 23H2 (Microsoft Windows [Version 10.0.22631.7079])
- Emacs: 30.2
- SBCL : 2.6.4
- SLIME: 2.32

Install Quicklisp library manager
cd C:\lang\sbclwork
curl -O https://beta.quicklisp.org/quicklisp.lisp
This will download quicklisp.lisp into C:\lang\sbclwork
Load Quicklisp into SBCL
sbcl --load quicklisp.lisp

Install it (only once) into SBCL system
* (quicklisp-quickstart:install)

Install CFFI
* (ql:quickload :cffi)

Verify CFFI is loaded and working
(ql:quickload :cffi)
(cffi:defcfun ("GetTickCount" get-tick-count) :uint32)
(get-tick-count)

This was all done from the terminal. Below shows how it looks like in SLIME
; SLIME 2.32
CL-USER> (load "~/quicklisp/setup.lisp")
T
CL-USER> (ql:quickload :cffi)
To load "cffi":
  Load 1 ASDF system:
    cffi
; Loading "cffi"
..............
(:CFFI)
CL-USER> (ql:quickload :cffi)
To load "cffi":
  Load 1 ASDF system:
    cffi
; Loading "cffi"

(:CFFI)
CL-USER> (cffi:defcfun ("GetTickCount" get-tick-count) :uint32)
GET-TICK-COUNT
CL-USER> (get-tick-count)
1556937609
CL-USER> 

No comments:

Installing CFFI on SBCL on Windows 11

Installing CFFI on SBCL on Windows 11 Version info: - OS: Windows 11 23H2 (Microsoft Windows [Version 10.0.22631.7079]) - Emacs: 30.2 - ...