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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,654b6f3511044d16 X-Google-Attributes: gid103376,public From: Greg Baker Subject: Re: Interfacing Ada Routines in C Date: 1996/09/11 Message-ID: <85u3t5wr8q.fsf@walleroo.rp.CSIRO.AU>#1/1 X-Deja-AN: 179869325 sender: usenet@rp.CSIRO.AU (Network news) x-nntp-posting-host: walleroo.rp.csiro.au references: <5156mj$gd0@rumors.ucr.edu> organization: CSIRO Division of Radiophysics/Australia Telescope National Facility newsgroups: comp.lang.ada Date: 1996-09-11T00:00:00+00:00 List-Id: sto@cs.ucr.edu (Steven To) writes: > Does anyone know how I can interface an Ada procedure in my > C program? > > I've tried the following unsuccessfully: > > Compiled the ada procedure into an object file. Included > the ada object file during the link, but the compiler isn't > able to find the procedure referenced in my C program. > > BTW, I am using gcc and Sun Ada on a Solaris platform. The Ada compiler does some slight name mangling (it includes the name of the package in the link name). Without checking too carefully.. Ada: package Foo is procedure Bar; end Foo; C: extern void foo__bar(); I derived the above information by compiling the foo package, and running "nm foo.o | grep bar". (Actually I did nothing of the sort, I'm just going from memory). Hope this helps. -- Gregory D. Baker gbaker@rp.csiro.au CSIRO Radiophysics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - predictions of the future - quantum computers - silly poetry - - the "langue musicale universale" (Solresol) revival project - - - - - - - - - http://www.rp.csiro.au/~gbaker - - - - - - - - - I am about to leave CSIRO. The above email address and URL may become invalid in October.