On Mon Dec 1, 2025 at 8:50 PM CET, Diogo via Chicken-users wrote:
> So in the previous example I sent, this is the generated wrapper:
>
>     ;; foo-wrap.scm - created with
>     ;;       chicken-crunch -emit-wrappers foo-wrap.scm foo.scm -o foo.c
>     (module
>       foo
>       (foo)
>       (import (scheme base) (chicken foreign))
>       (define foo#foo (begin (foreign-lambda integer foo))))
>
> I just don't know how to get a chicken library out of this file (plus the
> crunched foo.c). Trying to translate it to .c gives me
>
>     % csc -t foo-wrap.scm
>     Warning: Exported identifier `foo' has not been defined.
>     Error: module unresolved: foo
>
> May be the generated wrapper isn't correct? How should it look like?
>

Normally you should compile both wrapper and .c file together into
a shared library, like this:

  csc foo-wrap.scm foo.c -s -o foo.so -J

This should give you a module that you can load into CHICKEN and
run, including the import library. But the definition "foo#foo" is definitely 
wrong (it should
be just plain "foo"), so the module is unresolved. I will fix this
as soon as possible.


cheers,
felix


Reply via email to