Board index » delphi » linking pascal program into c program?!

linking pascal program into c program?!

i know there are ways to link c program into pascal program
is the vice versa possible? linking pascal program into c program?!
see you
jacky

 

Re:linking pascal program into c program?!


On Wed, 25 Mar 1998 07:10:26 -0500, "Jacky Luk" <wh...@hk.super.net>
wrote:

Quote
>i know there are ways to link c program into pascal program
>is the vice versa possible? linking pascal program into c program?!

You may link compiled C functions to a Borland Pascal program under
certain conditions - but you never can link procedures/functions
written in Borland Pascal to any other program. The problem is that
TP/BP doesn't compile to the standard OBJ format but to a special TPU
format which only TP/BP can use. The only way you might use BP code is
to put it into a DLL and use it from there.

Regards
Horst

   *** Las orillas del Nahuel Huapi ***

Re:linking pascal program into c program?!


Quote
Jacky Luk wrote:
> i know there are ways to link c program into pascal program
> is the vice versa possible? linking pascal program into c program?!
> see you

You don't link programs together, you link modules.  With TP, you can't use
modules generated by the compiler with C due to incompatibilities (TP produces
TPU files, not OBJ files).  With C, you can compile modules which use the
Pascal function calling style of parameter passing, but if that module has any
links to external units, including anything in the C runtime library, TP won't
be able to resolve the links.

Note:  GNU C and GNU Pascal may be able to share modules fairly easily, since
as I understand, the core compiler is either the same or similar.

Soon to be a Linux user, so I may be toying about with this.  :-)

Quote
> jacky

--
Scott Earnest            | SPAM protection in effect. Remove  |
setech@_ix.netcom.com    | "_" as needed for true addresses.  |
earnests@_homenet.lm.com |    UIN:1136443  EFnet:pale_blue    |
sinykal@_{*word*104}space.org  | URL: http://www.netcom.com/~setech |

Re:linking pascal program into c program?!


Quote
Scott Earnest <setech@_ix.netcom.com> wrote:

> Note:  GNU C and GNU Pascal may be able to share modules fairly easily, since
> as I understand,

It's known to work.  I do this all the time.

Quote
> the core compiler is either the same or similar.

The GNU compilers share the same backend, but they have different
frontends for Pascal, C, C++, ObjC, Fortran, Ada.

Greetings,

    Peter
--
    Peter Gerwinski, Essen, Germany, free physicist and programmer
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997
PGP key fingerprint:  AC 6C 94 45 BE 28 A4 96  0E CC E9 12 47 25 82 75
                Fight the SPAM! - http://maps.vix.com/

Other Threads