comp.lang.ada
 help / color / mirror / Atom feed
From: Chris Brand <cbrand@ccgate.hac.com>
Subject: Re: Linking an ADA routine to a program written in C
Date: 1996/09/20
Date: 1996-09-20T00:00:00+00:00	[thread overview]
Message-ID: <3242C60B.747D@ccgate.hac.com> (raw)
In-Reply-To: 32424C10.71A3@netvision.net.il


Calius wrote:
> [snip]
> 
> I'm sorry to "barge" into your thread here :), but I can tell you this:
> I've called ADA procedures which require elaboration from C several
> times. I know
> it works, and as Larry, it "just happens".  I can, however, explain WHY
> is "just
> happens" (Or so I think):
> 
> [more snipping]

I've used ada code with a C main program and with at least one compiler (DEC compiler on an
Alpha, I think), you had to call an elaboration routine before calling any ada. You also
had to call a "finalisation" routine when you'd finished calling ada.
There is usually some sort of compiler option to tell it to create an object file rather
than an executable, and it should include all the necessary ada code (including "with"ed
library packages) if you do this.
As has already been mentioned, you need to tell the ada code that your subprogram will be
called from C, and possibly what it should be known as to the linker.
You then just use your C compiler as usual and include your ada object file in the link.

-- 
Chris
Stating my own opinions, not those of my company.




  reply	other threads:[~1996-09-20  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
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 [this message]
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