[Ecls-list] How do I call a C func from ECL when embedded in an app

David Creelman dave at geko.net.au
Tue Jan 10 23:11:01 UTC 2006


I'm trying to call a C function from ECL. ECL is embedded into my
application (using WinXP).

I looked through the mailing list and found something like the following
as an example of how to use FFI, but I get an error:-

> (ffi:def-function ("number_plus" number-plus) ((a :int)
(b :int)) :returning :
> (number-plus 1 2)
The special form c-inline cannot be used in the interpreter.
Broken at NUMBER-PLUS.

I chose number-plus since it seemed most likely to be exported and
visible within ECL.

How do I define a function in C so that it's visible and callable from
ECL ? Is this possible without compiling the LISP code ?

Looked up the CFFI documentation, but it didn't seem to talk about how
to export the functions into ECL.

David Creelman
GPG: 11CC 0D54 D37A 4B9C 5C65  AB63 5B18 7F99 7D77 9CA5

More information about the ecl-devel mailing list