I have created a simple hello world (hello.lisp) ,code:
(defun main ()
(format t "Hello,World"))
, program to test CCL's native executable compilation. I proceed to compile and load buffer from the CCL GUI (using version Clozure Common Lisp Version 1.10-store-r16266 (DarwinX8664)).
When i test it:
? (main)
Hello,World
NIL
?
It finds the main function. When i proceed to compile it with: (save-application "/tmp/h" :toplevel-function #'main :prepend-kernel t)
, it proceeds with the operation and CCL exits.
The file is created and is arround ~56MB. When i try to run it though I get the following output:
Error: There is no applicable method for the generic function: # when called with arguments: (# :NOTE-CURRENT-PACKAGE #) While executing: #, in process toplevel(6). Error: There is no applicable method for the generic function: # when called with arguments: (# :BREAK-OPTIONS-STRING T) While executing: #, in process toplevel(6). Error: There is no applicable method for the generic function: # when called with arguments: (# :BREAK-OPTIONS-STRING T) While executing: #, in process toplevel(6). Error: There is no applicable method for the generic function: # when called with arguments:
And the errors proceed. What do I do wrong? Is it a bug?
Thank you
I found the keywords
:note-current-package
and:break-options-string
in the cocoa-ide of the sources. Sinceprepend-kernel t
prepends the kernel that was used in the current session, it seems that you would include the cocoa-ide startup in your application. However, the methods dispatching on those keywords only dispatch on ´ns-application`s, which your new application seems not to be.The solution might be to prepend a kernel without cocoa-ide, either by loading your code into a non-GUI image, or by using the pathname of such a kernel for the
:prepend-kernel
argument.