TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0 (Apple Message framework v619)
Content-Type:
text/plain; charset=US-ASCII; format=flowed
Date:
Tue, 14 Dec 2004 20:42:48 -0500
Reply-To:
"James E. Hopper" <[log in to unmask]>
Subject:
From:
"James E. Hopper" <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
7bit
Sender:
"Team Ada: Ada Programming Language Advocacy (83 & 95)" <[log in to unmask]>
Parts/Attachments:
text/plain (41 lines)
Well i do mixed ada and c++ all the time with gnat on mac os x and
linux.  no need for main program in c++.   i do use bindings that use c
style names for the c++ classes though.

jim

On Dec 14, 2004, at 1:58 PM, Karl Nyberg wrote:

> I have done a fair bit of interoperable program and data between C++
> and
> Ada95 with GNAT under Solaris, AIX and Linux and OCS PowerAda on AIX.
> In
> all these cases, the vendors provided examples that were sufficient to
> get
> started.  (Start by looking for any documentation on an "Application
> Binary
> Interface" among the compiler documentation you have - it may help you
> with
> some of the following issues).
>
> The most common issues are naming (source files, objects and internal
> representation of functions / procedures).  Exportation of Ada names
> generally requires putting them in the "C" style and declaring them as
> externs within C++ as C names, so that the name mangling issues will
> all
> resolve correctly.
>
> Generally a C++ main has been required, with the C++ linker (when the
> linkers differ), and some tricks are often pulled to do a transitive
> closure
> on all the required Ada names and make them available to the linker.
>
> The GNAT documentation has a nice little example that shows C++
> calling Ada
> calling C++.
>
> But on XP and with FORTRAN, well, I dunno...
>
> -- Karl --
>

ATOM RSS1 RSS2