From: mark@array.UUCP (Mark Culp)
Subject: Calling Ada routines from C programs.
Date: 15 Feb 91 18:14:48 GMT [thread overview]
Message-ID: <1884@array.UUCP> (raw)
We have a large application program developed in C that we would like to
port to an underlying operating system (CAIS-A) which is written in Ada.
Before we start on this attempt, we realize that our largest problem is
going to be trying to call an Ada routine from our C program.
I have attempted to call an Ada routine from a C sub-routine (of an Ada
main procedure) using the Telesoft Ada compiler, but have had no success
with the linker resolving the Ada's routine name.
Here is my test Ada source program:
with Text_IO;
procedure Ada_Routine is
begin
Text_IO.Put_Line( "Ada Routine" );
end Ada_Routine;
with Text_IO;
with Ada_Routine;
procedure Test_C_Interface is
procedure C_Main_Routine;
pragma Interface( C, C_Main_Routine );
begin
Text_IO.Put_Line( "Begin" );
C_Main_Routine;
Text_IO.Put_Line( "End" );
end Test_C_Interface;
and here is my test C routine:
#include <stdio.h>
void c_main_routine()
{
printf( "c_main_routine begin\n" );
ada_routine();
printf( "c_main_routine end\n" );
}
I have tried variations on the "ada_routine()" call, but with no success.
If you have attempted to do this, or know how to solve this problem,
I would be grateful to here from you. Please email, I will summarize.
Thanks.
Mark.
---------------------------------------------------------------------------
Mark N. Culp UUCP : {mnetor,utzoo}!lsuc!array!mark
Array Systems Computing Inc. Internet: mark@array
401 Magnetic Drive, Unit 24 Phone : +1(416)736-0900 Fax: (416)736-4715
Downsview, Ont CANADA M3J 3H9 Home : +1(416)857-5290
next reply other threads:[~1991-02-15 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-02-15 18:14 Mark Culp [this message]
1991-02-18 0:23 ` Calling Ada routines from C programs Jim Showalter
1991-02-18 16:14 ` Karl Keyte
1991-02-19 15:05 ` David Emery
1991-02-19 19:37 ` Bruce Bauman
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox