[fpc-pascal]FPC/Linux - how to link with c/c++ programs ?

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Sep 13 12:51:42 CEST 2000


On Wed, 13 Sep 2000, Piotr Skrzypczynski wrote:

> Hello.
> I'm new to this list, so sorry if I'm asking about obvious things.....
> Recently I've installed FPC 1.0 for Linux. It works fine - I have ported
> several of my old BP7/DOS programs, but now I want to know how to link
> procedures/libraries written in Pascal with c/c++ programs under Linux.
> Exactly, I need to link some numerical procedures I wrote in Pascal with a
> Linux program written in c++ (compiled with gcc). This is 3000+ lines of
> Pascal code so I'm looking for any other solution than convert it to c...
> 
> - Is it possible ?

Yes, but not easy.

> - Where can I find any exapmles of such 'mixed' programs ?

Best is to make a library, and link to it from C. See the reference manual
or programmers manuals for how to do this.

Michael.





More information about the fpc-pascal mailing list