comp.lang.ada
 help / color / mirror / Atom feed
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Re: Linking an ADA routine to a program written in C
Date: 1996/09/18
Date: 1996-09-18T00:00:00+00:00	[thread overview]
Message-ID: <1996Sep18.152409.1@eisner> (raw)
In-Reply-To: 51p2vu$enf@lal.interserv.com


Given the fact that you mention gcc, I suppose we might guess that
your Ada compiler is GNAT.

I just can't figure out how we will guess what type of computer you
are using.  Based on your comments about right-to-left and left-to-right,
I would tend to say Macintosh, but I know a reasonable amount about
Macintosh and have never heard the term "ELF-32".

Try writing a problem report like you were the person reading it.
Those Ada people are sticklers for clarity.

Larry Kilgallen

In article <51p2vu$enf@lal.interserv.com>, newmans@ncr.disa.mil writes:
> 
> I desperately need an explanation of how to link a routine written and compiled in ADA into a program
> written in C.  For example, I built an ada  test procedure hello.a and compiled it using the ada compiler.
> The object file produced was called hello01.  This program uses TEST_IO package to do the output.
> 
> Since the object module hello01 is ELF-32 bit I linked it in with my C objects using gcc.  But of course,
> I get undefined symbols because I have no idea how to tell gcc about the TEST_IO package.  
> 
> Does anyone know how this can be done.  
> 
> Also, some people have mentioned that I may have to use a PRAGMA in my C code to tell the
> compiler that the  routine I am calling  i.e. "hello"  is not a C subroutine.  C passes arguments from
> right to left.  I believe ADA probably passes them like PASCAL from left to right.  In C you can declare
> a routine to be type pascal to change the calling sequence to match PASCAL's.  If anyone has
> any experience calling ADA routines from C please contact me ASAP. 
> 
> 		Thank you! 




  reply	other threads:[~1996-09-18  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-18  0:00 Linking an ADA routine to a program written in C newmans
1996-09-18  0:00 ` Larry Kilgallen [this message]
1996-09-19  0:00 ` David C. Hoos, Sr.
1996-09-19  0:00   ` Larry Kilgallen
1996-09-20  0:00     ` Calius
1996-09-20  0:00       ` Chris Brand
1996-09-24  0:00   ` Cyrille Comar
1996-09-25  0:00     ` Larry Kilgallen
1996-09-26  0:00 ` Jens Jakob Jensen
  -- strict thread matches above, loose matches on Subject: below --
1996-09-28  0:00 Robert Dewar
1996-09-28  0:00 ` Larry Kilgallen
1996-10-03  0:00   ` Robert Dewar
1996-10-04  0:00 Larry Kilgallen
1996-10-08  0:00 ` Robert Dewar
replies disabled

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