comp.lang.ada
 help / color / mirror / Atom feed
* Using ObjectAda 7.1 SE lib in VC++ 5.0
@ 1999-04-12  0:00 Kai Glsner
  1999-04-14  0:00 ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Glsner @ 1999-04-12  0:00 UTC (permalink / raw)


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.
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......

Thanks in advance for the answer

Kai Glaesner







^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using ObjectAda 7.1 SE lib in VC++ 5.0
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Leake @ 1999-04-14  0:00 UTC (permalink / raw)


"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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using ObjectAda 7.1 SE lib in VC++ 5.0
  1999-04-14  0:00 ` Stephen Leake
@ 1999-04-15  0:00   ` Kai Glsner
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Glsner @ 1999-04-15  0:00 UTC (permalink / raw)



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






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-04-15  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox