[ab] HOWTO: Building standalone game EXEs with CLISP and lispbuilder-SDL on Windows
Anthony Fairchild
anthonyf at blarg.net
Tue Nov 21 16:21:37 CST 2006
Here's the promised HOWTO. Questions/comments welcome. Please let me
know if you have success or problems getting these steps to work.
Anthony
--------------------------------------------------------------------------
This is a how-to for building a distributable game(standalone
executable) using CLISP and lispbuilder-SDL on Windows.
1. Install CLISP. Version 2.41 (non-cygwin with readline and
gettext) was used for this howto. It can be downloaded here:
http://clisp.cons.org/
2. Install lispbuilder-SDL as described in the documentation
(http://lispbuilder.sourceforge.net/). Follow all instructions with
the following exception: Use CFFI version 061116. Version 060225 does
not work. CFFI can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/?M=D
3. Make sure everything works. Try to run an example. From the
CLISP prompt run:
[1]> (asdf:operate 'asdf:load-op :lispbuilder-sdl-examples)
... lots of loading text ...
0 errors, 0 warnings
NIL
[2]> (sdl-examples:squashed)
NIL
See the game run. If the game does not run properly, troubleshoot,
then continue to step 4.
4. Create a directory to put all of the distributable files in. For
example:
[3]> (ext:make-dir "C:\\appz\\")
T
[4]> (ext:make-dir "C:\\appz\\squashed\\")
T
5. Create a main entry point for your game. We will simply used the
Squashed game as an example. Create the SQUASHED-MAIN function:
[5]> (defun squashed-main ()
"Squashed: main entry function"
(cffi:define-foreign-library sdl
(t (:default "SDL")))
(cffi:use-foreign-library sdl)
(sdl:with-init ()
(sdl-examples:squashed))
(ext:quit))
SQUASHED-MAIN
6. Next, create the standalone executable.
*** One important thing to note here is you must call SAVEINITMEM from
the CLISP prompt and not SLIME. If you do it from SLIME you will get
a socket error in your executable. ***
[6]> (ext:saveinitmem "c:\\appz\\squashed\\squashed.exe"
:init-function #'squashed-main
:NORC t
:script t
:executable t
:quiet t)
2881776 ;
720444
7. Copy other support files to the distribution directory:
[7]> (ext:copy-file "C:\\clisp-2.41\\full\\*.dll" "C:\\appz\\squashed\\")
((#P"C:\\clisp-2.41\\full\\libiconv-2.dll"
#P"C:\\appz\\squashed\\libiconv-2.dll" 1410765)
(#P"C:\\clisp-2.41\\full\\libintl-8.dll" #P"C:\\appz\\squashed\\libintl-8.dll"
1888606)
(#P"C:\\clisp-2.41\\full\\readline5.dll" #P"C:\\appz\\squashed\\readline5.dll"
229888))
[8]> (ext:copy-file "C:\\windows\\system32\\SDL.dll" "C:\\appz\\squashed\\")
((#P"C:\\WINDOWS\\system32\\SDL.dll" #P"C:\\appz\\squashed\\SDL.dll" 258048))
8. Try running C:\appz\squashed\squashed.exe. If it runs then you
can now distribute the files located in C:\appz\squashed\. Note that
the CLISP console is present when running the game. To hide the
console screen take a look at this link:
http://www.frank-buss.de/lisp/clisp.html
9. Now go make some games!
More information about the application-builder
mailing list