bohonghuang / cl-gobject-introspection-wrapper

Wrap and call GObject Introspection FFI function in LISP style.
GNU Lesser General Public License v3.0
17 stars 4 forks source link

Please provide example of using with save-lisp-and-die #4

Open bigos opened 8 months ago

bigos commented 8 months ago

I have a problem when I try to run the generated executable. It happens on Windows and Linux.

debugger invoked on a SB-PCL::NO-APPLICABLE-METHOD-ERROR in thread

<THREAD tid=34879 "main thread" RUNNING {10024D0003}>:

There is no applicable method for the generic function

<STANDARD-GENERIC-FUNCTION GIR::NSGET (6)>

when called with arguments (NIL GTK4::NEW).

That may be a clue leading to a solution, but it needs more examples. https://github.com/andy128k/cl-gobject-introspection/issues/78

bohonghuang commented 8 months ago

Does (asdf:make :cl-gtk4/example) not work on your system?

bigos commented 8 months ago

https://github.com/bohonghuang/cl-gtk4/blob/96125a79b2d5c96c44b486fc29c4129d6f114627/cl-gtk4.asd#L16 The above may be the missing link I needed.

I will try it and let you know if I can successfully create a working executable or if I have more questions.

bigos commented 8 months ago

Thank you!!!! It works. At least on Linux.

https://github.com/bigos/clos-sweeper/blob/8e10e9c87566f4673f248db3ffa1ab3ca338c6fe/build-linux-executable.lisp#L5

https://github.com/bigos/clos-sweeper/blob/8e10e9c87566f4673f248db3ffa1ab3ca338c6fe/clos-sweeper.asd#L22

bigos commented 8 months ago

do you know how to declare sbcl compression levels?

bigos commented 8 months ago

https://github.com/lisp-tips/lisp-tips/issues/20

maybe this is the answer

bohonghuang commented 8 months ago

lisp-tips/lisp-tips#20

maybe this is the answer

This is the answer, adding this code snippet to the ASD file is exactly the approach I am currently using.

richardwesthaver commented 6 months ago

do you know how to declare sbcl compression levels?

you can use an integer instead of a boolean for the :compression keyword:

(sb-ext:save-lisp-and-die "x"
                          :toplevel #'compile-prelude
                          :executable t
                          :save-runtime-options t
                          :compression 19)