On Wed, Oct 24, 2012 at 10:24 AM, Ralph Möritz <ralph.moeritz@outlook.com> wrote:
I just downloaded MKCL-1.1.0 & tried compiling a small "Hello, world" program on Windows without success. Here's what I tried:

1. Add "C:\Program Files\MKCL 1.1\bin" to my PATH.
2. Run `mkcl -not-fasl-p -compile hello.lisp` which produces lisp.o
3. Now what? I've tried to link using `gcc -o hello.exe hello.o -lmkcl_1.1.0` which produces an error:

Such a direct call to gcc cannot work with a ".o" produced by the MKCL compiler (see [1] below as to why).
 
I've also tried `mkcl -o hello.exe -link hello.o` which produces the following error:

    build-program failed: Unknown keyword :LISP-FILES


That instead should have worked!  You have quite clearly hit a bug in MKCL-1.1.0.
But you see, that access from the command line to the #'compiler:build-program facility
is somewhat seldom used and has bit-rot without me noticing.  I will fix it in the coming
hours and that fix should be part of MKCL-1.1.1 (to be released soon I expect).

Let me stress the point that such a use of MKCL on the command line, although supported,
is somewhat atypical.  Like other Common Lisp systems, MKCL is mostly used through a REPL,
either MKCL's own default REPL (somewhat basic) or the REPL of SLIME (a much nicer one).
Also, producing a full OS native executable is a fairly rare event since the typical user of
MKCL will be building his CL world by loading (fasl or source) libraries at the REPL prompt.
Were you knowingly testing this command line option or did you hit on it more or less by chance?
In the second case I could suggest you some easy alternatives depending on your goal.

Cheers,

Jean-Claude Beaudoin


[1]  The ".o" object files produced by the MKCL native compiler are not quite basic C object
files, they contain hooks that need to be called with a specific context at load time in order
for its object code to integrate itself properly with the rest of the Common Lisp runtime system.
The compiler:build-program facility provides the framework for this to happen properly.