[fpc-devel] C++ source in fpc

Marco van de Voort marcov at stack.nl
Mon Sep 14 22:34:05 CEST 2009


In our previous episode, Desmond Coertzen said:
> I need some advice:
> 
> I have a few c++ source files containing conversion functions. Is it at all
> possible to compile them into my fpc project?
> 
> Is this possible with fpc? Am I under
> the influence of a pipe dream?

Wrap it in plain C and stuff it in a library with libstdC++ linked to it. Then write a Pascal header for
it, and use it like any C library.

> I imagine I have seen this in kylix 3.

Could be, but that is because Borland also has a BCB C++ compiler that is
kept strictly in line with Delphi from a compatibility aspect.

In BCB there is also specific syntax to declare stuff Delphi compatible.



More information about the fpc-devel mailing list