comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Ada and C++; Any Gurus Out There?
Date: 1999/06/02
Date: 1999-06-02T00:00:00+00:00	[thread overview]
Message-ID: <375574F7.501CDFB9@averstar.com> (raw)
In-Reply-To: XE953.4227$y6.2357136@WReNphoon3

Decker, Christian R wrote:
> ...
> 
> Now, I know one can declare the C++ function as 'extern "C" blah blah' but
> this really is a work around and not a
> solution.  I am looking for a way to simply link Ada and C++ object files
> such that no modifcations need to
> be made to the C++ code.  I also would like to only have to mess with the
> Ada code or Ada compiler/linker
> options id possible.

Few if any Ada compilers understand the mangling gyrations of the typical
C++ compiler.  Hence you need to use extern "C".  You don't need
to modify the existing C++ code to do this.  You could write an
interfacing layer in C++ that uses extern "C" for what it exports to Ada
(or C), and contains calls to the existing C++ routines of interest.

Also, if there is no overloading in the C++ header file, you
can rename the existing C++ header, create a new one with the
old name, consisting simply of:

extern "C" {
#include "renamed_header.h"
}

> ...
> Thanks!
> Chris

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




      parent reply	other threads:[~1999-06-02  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-02  0:00 Ada and C++; Any Gurus Out There? Decker, Christian R
1999-06-02  0:00 ` Robert Dewar
1999-06-02  0:00 ` Gisle S�lensminde
1999-06-03  0:00   ` Robert Dewar
1999-06-03  0:00     ` Gisle S�lensminde
1999-06-04  0:00       ` Robert Dewar
1999-06-02  0:00 ` Tucker Taft [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