From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6e688afdbf4b6072,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-22 05:26:45 PST Path: nntp.gmd.de!stern.fokus.gmd.de!ceres.fokus.gmd.de!zib-berlin.de!news.mathworks.com!uunet!in1.uu.net!world!blanket.mitre.org!linus.mitre.org!mbunix!costello From: costello@mbunix.mitre.org (Roger L Costello) Newsgroups: comp.lang.ada Subject: Calling Ada from C Date: 22 Mar 1995 13:26:45 GMT Organization: The MITRE Corporation, Bedford Mass. Distribution: usa Message-ID: <3kp8il$avh@linus.mitre.org> NNTP-Posting-Host: mbunix.mitre.org Date: 1995-03-22T13:26:45+00:00 List-Id: 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