[fpc-pascal] Re: Support for C++ library format?
章宏九
secludedsage at gmail.com
Mon Oct 5 15:55:15 CEST 2009
About C++ to C, you can see Sun developer's paper: Mixing C and C++
Code in the same program
(http://developers.sun.com/solaris/articles/mixing.html). Very
detailed and useful.
2009/10/5 Marco van de Voort <marcov at stack.nl>:
> 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)
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list