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

dev.dliw at gmail.com dev.dliw at gmail.com
Thu Aug 1 11:10:36 CEST 2013

> FYI, created wiki page http://wiki.lazarus.freepascal.org/SWIG to bundle
> information.

>It would of course be very welcome if somebody got the current version into
>main SWIG so it is more easily usable

The wiki page is a good idea, things have to be clarified though.

I don't know in how far others dealt with the code in the meantime - so this 
is my personal view:

When I ported the patch to 2.0.8 things looked quite good, the changes needed 
were very straightforward - and in the end the result was quite usable.

But IMO the code itself is / was a big mess and far from being clean & 
readable - which is no bigger problem if 'it simply works' :D

Now - I tried a port to latest swig (2.0.10) some months ago [even made a fork 
on github...], but never released, the reason: it doesn't work any more.
I didn't search for the relevant changes in their changelog, but I didn't 
managed to get it even compiled - too many functions simply were missing.

Even worse, the Fortran module (upon which the Delphi module is based) 
although being in trunk also didn't compile - exactly the same missing 

In short: IMHO the patch is too much bitrotten to be further used, I think a 
clean and new implementation from scratch would be the much better way.

Maybe this can do the trick, too:
I mean, h2pas does a decent job...

And if it's allowed to dream: one time fpc will simply link against C++ 
directly :)


More information about the fpc-pascal mailing list