comp.lang.ada
 help / color / mirror / Atom feed
From: costello@mbunix.mitre.org (Roger L Costello)
Subject: Calling Ada from C
Date: 22 Mar 1995 13:26:45 GMT
Date: 1995-03-22T13:26:45+00:00	[thread overview]
Message-ID: <3kp8il$avh@linus.mitre.org> (raw)

Hi Folks,
    I am trying (unsuccessfully) to call an Ada program from a C program.
I am using the SUN (VADS) Ada, and SUN C.  I am running on a SUN SPARC 10.

Here's my simple C program:

extern hello()'

main ()
{
   hello();
}

My intent is for this C program to call the following hello world Ada
program:

with text_io;

package hello_pkg is

   procedure hello;

pragma EXTERNAL (C, hello);
pragma EXTERNAL_NAME (hello, "hello");

end hello_pkg;

package body hello_pkg is


procedure hello is
i : integer := 0;
begin

    text_io.put_line ("Hello World");

end hello;

end hello_pkg;

I compiled the Ada program.  It generated hello02 and hello03 in the
.objects directory.

When I tried compiling/linking the C program:

cc test.c .objects/hello03

I got the following errors:

Undefined                       first referenced
 symbol                             in file
STACK_LIMIT                         ./.objects/hello03
_A_put_line.123S12.text_io          ./.objects/hello03
ld: fatal: Symbol referencing errors. No output written to a.out

I really haven't a clue what to do.  The SUN documenation hasn't
been of much help.  Can you assist?  Thanks in advance.  /Roger ~

Please respond to: costello@mitre.org




             reply	other threads:[~1995-03-22 13:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-22 13:26 Roger L Costello [this message]
1995-03-22 13:58 ` Calling Ada from C David Paton
1995-03-23 17:22 ` Theodore Dennison
1995-03-24 17:14   ` Larry Kilgallen, LJK Software
1995-03-26 11:53     ` Robert Dewar
1995-03-27 14:47       ` Theodore Dennison
1995-03-28  0:00         ` Cyrille Comar
1995-03-28  0:00         ` Robert Dewar
1995-03-29  2:47         ` Larry Kilgallen, LJK Software
1995-03-29  0:00           ` Theodore Dennison
1995-04-04  0:00             ` Robert Dewar
1995-03-27 19:48     ` Robert I. Eachus
1995-03-29  0:00       ` Larry Kilgallen, LJK Software
  -- strict thread matches above, loose matches on Subject: below --
2007-02-22 15:46 hannibal.holm
2007-02-22 16:17 ` Ludovic Brenta
2007-02-22 17:28 ` Adam Beneschan
2007-02-22 20:40 ` Aurele
2007-02-23 13:53 ` Stephen Leake
2007-02-27 12:49   ` hannibal.holm
2007-02-27 18:03     ` Adam Beneschan
2007-02-28  2:54     ` Jeffrey R. Carter
2000-08-25  0:00 Maxwelton
1996-10-29  0:00 How is an ADA compiler done? Robert Dewar
1996-11-08  0:00 ` calling ADA from C EDSTAM Mikael
1996-11-14  0:00   ` Robert Dewar
1991-02-23 16:01 calling Ada " David B Lightstone
1988-10-16  0:23 calling ada from c Maureen Cragg
1988-10-17 17:21 ` Maureen Cragg
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox