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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-23 14:18:47 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!gatech!udel!news.mathworks.com!uunet!in1.uu.net!boulder!news.coop.net!news.den.mmc.com!iplmail.orl.mmc.com!usenet From: Theodore Dennison Newsgroups: comp.lang.ada Subject: Re: Calling Ada from C Date: 23 Mar 1995 17:22:01 GMT Organization: IPL InterNetNews site Message-ID: <3ksanp$bab@theopolis.orl.mmc.com> References: <3kp8il$avh@linus.mitre.org> NNTP-Posting-Host: payday.orl.mmc.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit To: costello@mbunix.mitre.org X-URL: news:3kp8il$avh@linus.mitre.org Date: 1995-03-23T17:22:01+00:00 List-Id: Roger L Costello writes: > 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. .. > > text_io.put_line ("Hello World"); .. > > 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 > All Ada compilers come with their own executive to perform stuff like tasking, dynamic memory allocation/deallocation, and elaboration. As a result, certain operations are not available when your "main" program is a C program, not an Ada program. I/O for SunAda appears to be one of those things.Despite your protestations that "the Sun documentation hasn't been much help", Section 4.3 (Calling Ada From Other Languages) in the Sun Ada programer's guide goes over this in great detail. If you make your main program an Ada program, you can call C routines with little trouble. These C routines in turn can call Ada routines with no trouble. This "wrapper" approach is specificly suggested by the SunAda manual (section 4.2). I have used this approach in the past in real-world applications (gory details available upon request). If you need any further info, just ask (I love this stuff). T.E.D.