[fpc-pascal] Automatically exporting C++ API using SWIG??

Reinier Olislagers reinierolislagers at gmail.com
Tue Jun 19 09:51:27 CEST 2012


The recent thread about using C headers made me think about using C++
projects.

Found that the SWIG tool converts C/C++ .h files into glue code and
bindings for e.g. Python, Modula 3... but not Delphi/Object Pascal.

It seems you get an object-oriented binding.

Did see this post from 2010 about Delphi support:
http://stackoverflow.com/questions/2559995/create-an-instance-of-an-exported-c-class-from-delphi
> I've written a SWIG module targetting ObjectPascal and I'm using it
> successfully in my own project. I've traslated GEOS, and GDAL/OGR
> library. I also have a branch in the SWIG repository, BUT I still
> have to complete the final steps to build all the test suites and to
> fixup the typemaps in order to have the module be accepted.

... in a quick browse, couldn't find that branch though.
(Note: the poster's mail address is mentioned in that post)

Perhaps this could be useful for somebody interested in this/needing
this kind of functionality.

Thanks,
Reinier



More information about the fpc-pascal mailing list