[fpc-pascal] connecting with Delphi (object files,dll etc)

Peter Vreman peter at freepascal.org
Fri Mar 31 13:14:41 CEST 2006


> I have a question concerning connecting FreePascal function with Delphi
> application (under win32).
>
> I hope I'm totally wrong in my approach and so hope for some help.
>
> 1. DLL files created by FPC 2.0.2 are not usable under Delphi forms (there
> are about 5 posted unfixed bugs about it by different persons). (But they
> work, e.g. when you use FPC-FPC.)

These are then mostly things not directly needed/interressed by the core
developpers. We do it for fun so it can be that some complex issues likes
this stay open for a long time.


> 2. Of course, rewriting source to be Delphi compatible is poor option: it
> requires some work and gets slow working program (I want (have) Delphi
> frontend for intensely calculating FPC console program/unit/library).

You can rewrite the frontend in Lazarus.


> 3. Connecting object file is difficult: FPC doesn't support OMF (object
> files), and in FPC 2.0.2 support for COFF (object files) seems to be
> dropped. FPC produces PECOFF (object files).
> Sometimes you can translate COFF to OMF by (free?) Borland utility
> COFF2OMF, but it's not well documented: FPC *.o files are not translated,
> and I don't know the exact reason (is it their PECOFFness or some other
> incompatibility? maybe I just use them in a wrong way?).

This is not correct. COFF is support, it is the object format of go32v2.
Ofcourse is this not supported for the win32 target. Just like ELF is not
supported for win32.


> If this approach (DLL or object files) is despairing, I add a few words
> about two other methods...
>
> 4. Pipes are nice when you redirect stdout of some utility to file, but
> are pretty unclearly documented (yes, I do grow my hands from behind and
> can't get them to work stable for Delphi-FPC pair with bidirectional
> information flow).
>
> 5. The last approach is freaky: just run one application from the other
> and exchange information via named file on disk.

TCPIP Sockets?






More information about the fpc-pascal mailing list