comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Using ObjectAda 7.1 SE lib in VC++ 5.0
Date: 1999/04/14
Date: 1999-04-14T00:00:00+00:00	[thread overview]
Message-ID: <u4smjxidl.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 923920517.42691@demdwu29

"Kai Glsner" <kai.glaesner@daimlerchrysler.com> writes:

> Hello community,
> 
> currently I'm using ObjectAda 7.1 SE to become familiar with Ada-95. Is it
> possible to use any code (e.g. the object-file or a library), written with
> this environment, as a static library in VC++ 5.0? And if "yes", how to do
> this.

Yes, you can.

You need to add 'pragma Export (C, ...)' for each Ada function you
want to call from C++. In C, you need to declare the Ada functions
with 'extern C'.

ObjectAda will build object files (.obj). You can either just link
those directly into your VC++ project, or use the MS tools to build a
library.

> The background is, that I would like to migrate to Ada-95 in a soft but
> steady manner, starting with doing some libs in Ada, and then, may be, do
> most of it with Ada-95, that means, calling C-Sources from Ada......

Wait a minute - above you implied you wanted to call Ada from C++. Now
you want to call C from Ada. This is equally possible, using pragma
Import. However, calling C++ member functions is generally not
possible; you'll need to provide an 'extern C' wrapper.

Either way, a gradual transition is definitely the way to go.

-- Stephe




  reply	other threads:[~1999-04-14  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-12  0:00 Using ObjectAda 7.1 SE lib in VC++ 5.0 Kai Glsner
1999-04-14  0:00 ` Stephen Leake [this message]
1999-04-15  0:00   ` Kai Glsner
replies disabled

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