From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3173a3d7ff642bc X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Using ObjectAda 7.1 SE lib in VC++ 5.0 Date: 1999/04/14 Message-ID: #1/1 X-Deja-AN: 466354297 References: <923920517.42691@demdwu29> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1999-04-14T00:00:00+00:00 List-Id: "Kai Glsner" 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