comp.lang.ada
 help / color / mirror / Atom feed
From: "Kai Glsner" <kai.glaesner@daimlerchrysler.com>
Subject: Re: Using ObjectAda 7.1 SE lib in VC++ 5.0
Date: 1999/04/15
Date: 1999-04-15T00:00:00+00:00	[thread overview]
Message-ID: <924177184.763517@demdwu29> (raw)
In-Reply-To: u4smjxidl.fsf@gsfc.nasa.gov


Stephen Leake schrieb in Nachricht ...
>"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.
>

Funny, isn't it?
No, today the "main()" is a C++ Programm, so we will call Ada-Functions from
C++. If everything works well, after lots of C functions the main() will be
(hopefully) rewritten in Ada. Then we will call the (hopefully few)
remaining C-function from Ada.



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






      reply	other threads:[~1999-04-15  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
1999-04-15  0:00   ` Kai Glsner [this message]
replies disabled

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