[fpc-pascal] Re: Support for C++ library format?
Marco van de Voort
marcov at stack.nl
Mon Oct 5 12:36:19 CEST 2009
In our previous episode, Gilles MARCOU said:
> I believe that using C++ objects directly is not very easy. I have found
> some time ago this site about how to do this in Delphi.
>
> http://rvelthuis.de/articles/articles-cppobjs.html
> However, Borland used to publish a C++ compiler at that time. And I
> believe that this solution is compiler dependant.
Yes. Random C++ compilers can't use eachothers classes.
> Overall, I think that wrapping the object into C function then in Free
> Pascal is the easy way. If C++ objects are really needed, I prefere to
> write a C++ procedure to perform everything that really needs this
> coding, then I wrap it in C and Free Pascal.
Correct, and Rudy above also advises this. It can also be used to hide other
problems, like C++ template and other constructs that can't be properly
exported to any other compiler. (including other C++ compilers)
More information about the fpc-pascal
mailing list