[Ecls-list] calling ECL functions defined in an ASDF package from C code

Eric Schulte schulte.eric at gmail.com
Sat Jun 25 03:07:42 UTC 2011


I've written a library for reading/manipulating/writing elf files [1]
which I would like to be able to call from C code.  I have successfully
compiled the ASDF package defining the library into a libelf.a library
using the following command.

  (asdf:make-build :elf :type :lib :move-here "/home/eschulte/src/elf/")

While this seems to have been successful, and while I have been able to
manipulate generic ECL lisp objects from within C code, I can not figure
out how to access the lisp functions defined in this static library from
a file of C code.

My latest attempt is the following run.c file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run.c
Type: text/x-csrc
Size: 584 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20110624/709dee92/attachment.c>
-------------- next part --------------

I can compile this file with the following

  $ gcc -o run run.c -L. -lelf -lecl

however upon execution I get the following output in which the elf
package does not seem to be present.

| Condition of type: UNDEFINED-FUNCTION
| The function ELF::READ-ELF is undefined.
| No restarts available.
| Top level.
| > 

Ideally I'd like to be able to call the lisp functions defined in the
elf package as C functions directly in C, however I have no idea what
their names are, or how to access them from the world of C.

And advice would be greatly appreciated.

Thanks -- Eric

[1]  http://gitweb.adaptive.cs.unm.edu/elf.git

Eric Schulte

More information about the ecl-devel mailing list