Example program

pdoherty pdoherty at protonmail.com
Fri Dec 4 16:05:30 UTC 2020


Have you looked into the [ffi:load-foreign-library](https://common-lisp.net/project/ecl/static/manual/Foreign-Function-Interface.html#index-ffi_003aload_002dforeign_002dlibrary) macro? You may also want to look at the CFFI entry and consider using that library (rationale and link is in docs).

Also, if you haven't already, you may want to review [the examples in the ECL GitLab repository](https://gitlab.com/embeddable-common-lisp/ecl/-/tree/develop/examples).

PRD

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, December 3rd, 2020 at 9:31 PM, Garrett Dangerfield <garrett at dangerimp.com> wrote:

> Thanks, that was very helpful.
>
> The current situation I'm facing is how to actually utilize an OBJ file. I can generate one, no problem (yay). I can link it into an EXE it doesn't seem to want to reference it. I expect I need to do some sort of "load" on it (which I can do with Lisp files) to get it into the Lisp symbol system.
>
> I trying creating a DLL and that was successful but then when I try and link the EXE together using the DLL it says the DLL file format is unrecognized (this was with a shared library DLL).
>
> So, some general direction would be helpful and--more specifically--how to tell ECL to load an OBJ file would be great. (load "xxx.obj") didn't go so well. :-)
>
> Thanks,
> Garrett Dangerfield.
>
> On Thu, Dec 3, 2020 at 12:53 PM pdoherty <pdoherty at protonmail.com> wrote:
>
>> I can't speak to the Windows requirement, but this example I put together should help get you started:
>>
>> https://github.com/ethagnawl/ecl-hello-r-lisp
>>
>> PRD
>>
>> Sent from ProtonMail mobile
>>
>> -------- Original Message --------
>> On Dec 3, 2020, 3:45 PM, Garrett Dangerfield < garrett at dangerimp.com> wrote:
>>
>>> Is there an simple example program somewhere (I can't find one) that shows a function defined in a Lisp file and then used in a C/C++ file? With all the compile and linking commands needed to make it work?
>>>
>>> Ideally for Windows using Microsoft command line tools.
>>>
>>> Thanks much,
>>> Garrett Dangerfield.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20201204/35f559ec/attachment.htm>


More information about the ecl-devel mailing list