Sure! Please find attached two examples. The examples use the "sin" function from libm.
What I'm trying to achieve is producing a static library that makes use of foreign functions. The ECL I'm using is built without DFFI. I'm using the latest version from git. In each example you can LOAD the file `build.lisp' into ECL (please, change the paths as necessary). It should create a static library for the corresponding example. Then, you can use `make' to build an executable that is linked against the static library. The first example is ffi-test. It contains an example using the low-level FFI of ECL. This example works nicely. The other example is cffi-test. Lamentably, I haven't managed to make it work. I would like to reproduce the functionality of ffi-test in cffi-test. That is, I would like to produce a static library that uses CFFI to access foreign functions. I'm sure I'm missing something in cffi-test. I've tried different ways of compiling, but with no success. Thank you very much! -- Simón Ortiz B., M.Sc., Ing. en Computación Linux Registered User #388735 On 17 August 2012 20:13, Juan Jose Garcia-Ripoll <juanjose.garciarip...@gmail.com> wrote: > On Thu, Aug 9, 2012 at 1:31 PM, Simon Ortiz <o.si...@gmail.com> wrote: >> >> Now, I would like to achieve the same using CFFI instead of FFI. Using >> CFFI I tried several approaches, but I wasn't successful. Basically, I >> compiled the Lisp code into a static library, but the produced library >> seems not to include the C library. I tried to load the library at >> compile time with FFI:LOAD-FOREIGN-LIBRARY, but it doesn't seem to >> have any effect. > > > ECL has two ways to use a foreign library: one is to link with it, the other > one is to load it dynamically. Could you produce a tiny example of what you > are trying to achieve so that I can test it or improve it? > > Juanjo > > -- > Instituto de Física Fundamental, CSIC > c/ Serrano, 113b, Madrid 28006 (Spain) > http://juanjose.garciaripoll.googlepages.com
ffi-test.tgz
Description: GNU Zip compressed data
cffi-test.tgz
Description: GNU Zip compressed data
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list