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

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat Jun 25 07:24:54 UTC 2011


On Sat, Jun 25, 2011 at 5:07 AM, Eric Schulte <schulte.eric at gmail.com>wrote:

> 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.
>

You are still missing a crucial step: building your library into a program.
This is the reason why MAKE-BUILD has another target, :type :program, which
does the missing steps: linking C and Lisp code together.


> My latest attempt is the following run.c file.
>

File is missing all the steps that MAKE-BUILD takes to initialize the
library. There is a reason why MAKE-BUILD and C:BUILDER exist: to hide this
interface from you because it is very ugly and prone to change -- if you
read my other email today, those changes are related to this interface
(loading libraries and initializing their data).

I now realize C:BUILDER and C:MAKE-BUILD might need another target,
something like :standalone-lib or :standalone-dll, where one would simply
specify the name of the library and its initialization function and it would
do the rest. I will note it down.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20110625/24378464/attachment.html>


More information about the ecl-devel mailing list