[Ecls-list] Assistance with Embedded ECL Application...
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Thu Oct 29 21:39:41 UTC 2009
On Thu, Oct 29, 2009 at 10:30 PM, Brad Beer <bradwbeer at gmail.com> wrote:
> Hello,
>
> My name is Brad and I am trying to add ECL to an application with several
> external, but staticlly linked, libraries. Some of them are OpenGL, SDL,
> SDL_Mixer, Pango, Cairo... What is the best way to insert these functions,
> structures, callbackes, etc. into ECL? FFI doens't seem to work because they
> are staticlly linked.
You can produce FASLs, DLLs, programs using Lisp code and statically
linked foreign libraries. One part of the problem, that is linking the
libraries, is solved by providing the appropriate linker flags. This
can be done using our ASDF extensions or some lower level functions
which are not documented
http://ecls.sourceforge.net/new-manual/re03.html
(somehow the text in the manual got garbled, I suspect this has to do
with my newer version of dockbook)
> Do I need to write a wrapper for each function and if
> so, how do I handle exceptions and structures.
You can embed C code directly inside the lisp code. This allows
writing wrappers very easily, even in an automated fashion. See
ecl/contrib/sockets/sockets.lisp to get a feeling. The syntax is
explained here
http://ecls.sourceforge.net/new-manual/ch18.html
> Yes, it is a graphics application and I would like to move most of the work
> to the ECL side. Also, I would like to distribute it on windows where they
> might not have a compiler ready.
You do not need a compiler if you provide all code pre-compiled or
even linked in an standalone program.
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list