Jul 072009
 

Now here are steps to build a Windows application as for “hello, world” ๐Ÿ™‚

Create a message.lisp:

(use-package "FFI")
(def-call-out messagebox
              (:name "MessageBoxA") (:library "user32.dll")
              (:arguments (hwnd int) (text c-string) (capt c-string) (type uint))
              (:return-type int)
              (:language :stdc))

(defun main()
  (messagebox 0 "Hello World!" "Message" 0)
  (quit))

then run:

clisp -M “C:\Program Files\clisp-2.47\base\lispinit.mem” -x “(load \”message.lisp\”)(ext:saveinitmem \”message\” :init-function #’main :executable t :norc t :quiet t)”helloworld

now we have a message.exe under the same directory, run it, you will get a standard Windows message box like this:

Almost all stuffs mentioned here are coming from:

http://www.frank-buss.de/lisp/clisp.html

except I added “:quiet t” to avoid CLisp’s welcome messages printed out in screen.

  One Response to “Hello, world from CLisp on Windows”

  1. The Windows application still has a command window, need to get this solved.

Sorry, the comment form is closed at this time.