[Lazarus] How to access libraries from other languages?

Sven Barth pascaldragon at googlemail.com
Sun Feb 15 19:33:54 CET 2015

On 15.02.2015 16:46, Chavoux Luyt wrote:
> Hi guys,
> The recent threat on Raspberry libraries made me think. I remember that
> it was possible in Delphi to access .ddl libraries written in C or C++
> (a bit more work) by wrapping them and using a "far" call? I did this a
> while ago, so not clear on the details anymore. Typically I would write
> a driver etc. for hardware in C/C++ and then have a Delphi wrapper class
> that I could use to access the hardware. I assume this is still possible
> in Lazarus? Are there any tutorials etc. or will the old Delphi methods
> still work? Will this also work with Linux .so files? For that matter,
> are there any other way for Lazarus to get direct access to the hardware
> (except maybe use inline assembler)?
> Thanks for bringing me back up to speed!

C libraries are no problem. In fact we have many import units for 
various C libraries (e.g. X11, Gtk, etc.). C++ is more problematic. In 
theory the compiler contains support for C++ classes, but that is 
nowhere near usable currently so a C++ API needs to be flattened to a C 
one like is done with the Qt libraries.


More information about the Lazarus mailing list