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: "Kai Glsner" Subject: Re: Using ObjectAda 7.1 SE lib in VC++ 5.0 Date: 1999/04/15 Message-ID: <924177184.763517@demdwu29>#1/1 X-Deja-AN: 466683499 Cache-Post-Path: demdwu29!unknown@pluto1.str.daimler-benz.com References: <923920517.42691@demdwu29> X-Forwarded: by - (DeleGate/5.8.8) X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Trace: news1.cityweb.de 924177184 193.189.224.35 (Thu, 15 Apr 1999 13:53:04 MET DST) Organization: DaimlerChrysler X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Date: Thu, 15 Apr 1999 13:53:04 MET DST Newsgroups: comp.lang.ada Date: 1999-04-15T00:00:00+00:00 List-Id: Stephen Leake schrieb in Nachricht ... >"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. > 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