comp.lang.ada
 help / color / mirror / Atom feed
* Re: Linking C++ and Ada
  1996-02-22  0:00 Linking C++ and Ada Howard A. Free
  1996-02-22  0:00 ` Gilles Demailly
@ 1996-02-22  0:00 ` Nasser Abbasi
  1 sibling, 0 replies; 6+ messages in thread
From: Nasser Abbasi @ 1996-02-22  0:00 UTC (permalink / raw)


In article <4gh0sg$j4r@giant.seas.smu.edu>, hafree@seas.smu.edu (Howard A. Free) says:

>  (Hopefully I've done this correctly. I've not sent many messages
>  from a UN*X box. I'd forgotten just how oh-so-friendly they can be.)
>
Look into getting Eudora email system, from Qualcomm Inc. A very 
easy and user firendly email system designed for open systems. 
Runs on many platforms. 

As for your original question, Are you asking about Ada95 or Ada83?

Nasser




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Linking C++ and Ada
  1996-02-22  0:00 Linking C++ and Ada Howard A. Free
@ 1996-02-22  0:00 ` Gilles Demailly
  1996-02-26  0:00   ` Scott Moody, 773-8600
  1996-02-22  0:00 ` Nasser Abbasi
  1 sibling, 1 reply; 6+ messages in thread
From: Gilles Demailly @ 1996-02-22  0:00 UTC (permalink / raw)
  To: Howard A. Free


Hi Howard,

check the GNAT examples included in the distribution, there is an example
about calling some C++ code.

--Gilles




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Linking C++ and Ada
@ 1996-02-22  0:00 Howard A. Free
  1996-02-22  0:00 ` Gilles Demailly
  1996-02-22  0:00 ` Nasser Abbasi
  0 siblings, 2 replies; 6+ messages in thread
From: Howard A. Free @ 1996-02-22  0:00 UTC (permalink / raw)


  I've got a question that I'm hoping some of you Ada and C++
  guru's can help me with.

  I'm a grad student at SMU in Software Engineering and I'm
  doing a research project for a company. They want to know how
  to have C++ and Ada code "talk" to each other. Basically they
  want a list of possible solutions and the pro's and con's of
  each.

  I've started by looking at the Ada FAQ and in the Ada Clearing
  House as well as done a WWW search (using various search engines)
  but I haven't come up with much yet.

  Any clues, personal ancedotes (sp?), hits or suggestions on where
  to find some info would be greatly appreciated.

  Howard Free
  hafree@seas.smu.edu

  (Hopefully I've done this correctly. I've not sent many messages
  from a UN*X box. I'd forgotten just how oh-so-friendly they can be.)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Linking C++ and Ada
@ 1996-02-23  0:00 Simon Johnston
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Johnston @ 1996-02-23  0:00 UTC (permalink / raw)


> In article <4gh0sg$j4r@giant.seas.smu.edu>, hafree@seas.smu.edu (Howard A.
> Free) says:
>
> >  (Hopefully I've done this correctly. I've not sent many messages
> >  from a UN*X box. I'd forgotten just how oh-so-friendly they can be.)
> >
> Look into getting Eudora email system, from Qualcomm Inc. A very
> easy and user firendly email system designed for open systems.
> Runs on many platforms.

Or Pegasus (DOS, Mac and Windows) which is great and has a nice filtering
system which allows me to seperate all these mailing lists from my incoming
mail.

> As for your original question, Are you asking about Ada95 or Ada83?
>
> Nasser
>
>

with StandardDisclaimer; use StandardDisclaimer;
package Sig is
--,-------------------------------------------------------------------------.
--|Simon K. Johnston - Development Engineer (C++/Ada95) |ICL Retail Systems |
--|-----------------------------------------------------|3/4 Willoughby Road|
--|Unix Mail: skj@acm.org                               |Bracknell          |
--|Telephone: +44 (0)1344 476320 Fax: +44 (0)1344 476302|Berkshire          |
--|Internal : 7261 6320   OP Mail: S.K.Johnston@BRA0801 |RG12 8TJ           |
--|WWW URL  : http://www.acm.org/~skj/                  |United Kingdom     |
--`-------------------------------------------------------------------------'
end Sig;




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Linking C++ and Ada
  1996-02-22  0:00 ` Gilles Demailly
@ 1996-02-26  0:00   ` Scott Moody, 773-8600
  1996-02-27  0:00     ` Samuel Tardieu
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Moody, 773-8600 @ 1996-02-26  0:00 UTC (permalink / raw)


>check the GNAT examples included in the distribution, there is an example
>about calling some C++ code.

This brings up a question. GNAT has a few pragmas for linking
to C++ that are not part of the Ada standard. I haven't even
seen them until looking at the ex6 example. Should I start using
these non-standard pragmas? It would definitely help my corba interface...

eg.

pragma CPP_Class (Entity => A);
pragma CPP_Vtable (Entity => A, Vtable_Ptr => Vptr, Entry_Count => 2);
pragma CPP_Constructor (Entity => Constructor);




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Linking C++ and Ada
  1996-02-26  0:00   ` Scott Moody, 773-8600
@ 1996-02-27  0:00     ` Samuel Tardieu
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Tardieu @ 1996-02-27  0:00 UTC (permalink / raw)


>>>>> "Scott" == Scott Moody, 773-8600 <scott@hakuin.boeing.com> writes:

Scott> This brings up a question. GNAT has a few pragmas for linking
Scott> to C++ that are not part of the Ada standard. I haven't even
Scott> seen them until looking at the ex6 example. Should I start
Scott> using these non-standard pragmas? It would definitely help my
Scott> corba interface...

C++ compilers each have their own way of mangling function names to
support overloading. The interface between Ada and C++ implies that
the Ada compiler knows how the C++ compiler changes the function
names. Moreover, there is actually no standard way of implementing
dispatch tables in C++, so this is one more piece of information that
the Ada compiler must know.

Since GNAT and g++ use the same back-end to generate the machine code,
GNAT should do a pretty good job in interfacing with C++. I cannot
imagine how another compiler vendor which does not provide its own C++
compiler could implement this in a better way.

But of course, if you want to stay truly portable, you should
definitively *NOT* use these pragmas and forgive the idea of mixing
C++ and Ada classes :)

  Sam

PS/ as an example, here are the linker names defined by CC and g++ (on
    a Solaris machine) for the following C++ file:

    t.C
    ===
    #include <string.h>
    int f(int x){return x;}
    int f(char *x){return strlen(x);}
    int f(char x){return x;}

    CC
    ==
    __0FBfi
    __0FBfPc
    __0FBfc

    g++
    ===
    f__Fi
    f__FPc
    f__Fc
--
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-02-27  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-02-22  0:00 Linking C++ and Ada Howard A. Free
1996-02-22  0:00 ` Gilles Demailly
1996-02-26  0:00   ` Scott Moody, 773-8600
1996-02-27  0:00     ` Samuel Tardieu
1996-02-22  0:00 ` Nasser Abbasi
  -- strict thread matches above, loose matches on Subject: below --
1996-02-23  0:00 Simon Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox