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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9b1d37f5a56928f1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-11 01:51:03 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: julian_robbins@bigfoot.com (Julian Robbins) Newsgroups: comp.lang.ada Subject: Re: Calling Ada from C++ (MS Visual C++) Date: 11 Apr 2002 01:51:02 -0700 Organization: http://groups.google.com/ Message-ID: <3ab585c8.0204110051.3659218c@posting.google.com> References: <3ab585c8.0204050030.3d94e692@posting.google.com> NNTP-Posting-Host: 193.123.204.66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1018515063 29707 127.0.0.1 (11 Apr 2002 08:51:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 11 Apr 2002 08:51:03 GMT Xref: archiver1.google.com comp.lang.ada:22348 Date: 2002-04-11T08:51:03+00:00 List-Id: Okay, so here is what I have done... Compiled the original "mathutil.adb" into "mathutil.o". Then used "gnatbind -n mathutil" which produced the files "b~mathutil.adb" and ".ads". I then compiled these using gcc and renamed the resulting .o file "main.o". Within my VC++ project I have then included the mathutil.o and main.o files, added calls to adainit() and adafinal() and then compiled/linked. This throws up various missing links, so I have included the following library files: libgnat.a libgcc.a libmingw32.a Does this seem correct?? It seems to compile and run, but I can't help thinking that this process seems a bit odd. Cheers, Julian Stephen Leake wrote in message news:... > julian_robbins@bigfoot.com (Julian Robbins) writes: > > > So, using GNAT I believe that I can include the 'adainit()' and > > 'adafinal()' in the binding stage using 'gnatbind -n mathutil.ali'. > > However, this seems to produce a .o file that I could then only use > > with gnatlink to link the C++ objects and Ada objects together. This I > > can not do - I need to use MS Visual Studio to link the final > > executable, including any relevant Ada objects. > > You can link the .o file containing adafinal() and adainit() with your > C++ code, same as any other Ada .o.