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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 1014db,9a2aaa729f5fbd16 X-Google-Thread: 103376,9a2aaa729f5fbd16 X-Google-Attributes: gid1014db,gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!s12g2000prg.googlegroups.com!not-for-mail From: Lucretia Newsgroups: comp.lang.c, comp.lang.ada Subject: Re: C and ADA Date: Wed, 2 Jan 2008 15:09:12 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 90.194.162.37 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1199315352 17919 127.0.0.1 (2 Jan 2008 23:09:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Jan 2008 23:09:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s12g2000prg.googlegroups.com; posting-host=90.194.162.37; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.10) Gecko/20061201 Firefox/2.0.0.10 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.c:154118 comp.lang.ada:19161 Date: 2008-01-02T15:09:12-08:00 List-Id: On Jan 2, 10:33 pm, Brian wrote: > Hi I have an ADA function that I'd like to call from my C program. > > Is there any way to provide a .h file containing a C prototype for the > ADA function and then link the ADA with the C? Does anyone have any > experience of this? > > I'm using a GNU setup on Linux. > > Thanks. You can add a "pragma Export" to your procedure and compile it with gnat. There is a chapter on mixed language programming in the GNAT manual. But I think you might end up having to build the app with gnat. Surely porting the procedure would be easier? Luke.