Console Hello World howto

"Dave Mihalik" <[email protected]> Wed, 12 Jul 2006 20:39:06 -0400
Newsgroups gmane.lisp.allegro
Message-ID <000001c6a614$bf82b990$1e97a8c0@toyroom1>
Can someone show me how to create a console application that prints hello
world to the console on Microsoft Windows?

 

I am not interested in creating a Windows application but rather a console
application on the Windows platform.

 

I have created a project called test1 and added a file called test1.cl with
the following contents:

 

(defun test1()

  

(let ((mystring1 ""))) 

(setf mystring1 "Hello World")

(print mystring1)

  

)

 

I compiled the program into an executable and when I execute it, the
following appears in the debug console:

 

International Allegro CL Free Express Edition

8.0 [Windows] (Jul 12, 2006 20:34)

Copyright (C) 1985-2006, Franz Inc., Oakland, CA, USA.  All Rights Reserved.

 

This development copy of Allegro CL is licensed to:

   Trial User

 

;;---

;; The compiler is not loaded into this lisp.

; Foreign loading ole32.dll.

; Foreign loading advapi32.dll.

; Foreign loading oleaut32.dll.

; Foreign loading riched32.dll.

Error: The project has no main form to run.  Either use File | New Form

       to add a form to the project, or give the project a custom

       on-initialization function.

 

Restart actions (select using :continue):

 0: Abort entirely from this (lisp) process.

 

[changing package from "COMMON-LISP-USER" to "COMMON-GRAPHICS-USER"]

[Current process: Initial Lisp Listener]

[1] CG-USER(1):

 

 

At this point, I am trying to set the on-initialization function.  I set the
Init Fn: field to test1 on the Options tab of the Project Manager which when
saved gets set to CG-USER::TEST1.  

 

I compiled the executable file again and when run, the following appears in
the debug console:

 

This development copy of Allegro CL is licensed to:

   Trial User

 

;;---

;; The compiler is not loaded into this lisp.

; Foreign loading ole32.dll.

; Foreign loading advapi32.dll.

; Foreign loading oleaut32.dll.

; Foreign loading riched32.dll.

Error: attempt to call `TEST1' which is an undefined function.

  [condition type: UNDEFINED-FUNCTION]

 

Restart actions (select using :continue):

 0: Try calling TEST1 again.

 1: Try calling COMMON-LISP-USER::TEST1 instead.

 2: Return a value instead of calling TEST1.

 3: Try calling a function other than TEST1.

 4: Setf the symbol-function of TEST1 and call it again.

 5: Abort entirely from this (lisp) process.

 

[changing package from "COMMON-LISP-USER" to "COMMON-GRAPHICS-USER"]

[Current process: Initial Lisp Listener]

[1] CG-USER(1):

 

I am not sure what to do at this point.  Any help is appreciated.

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/386 - Release Date: 7/12/2006