comp.lang.ada
 help / color / mirror / Atom feed
* gnat link to c++ classes (all gcc)
@ 2003-03-24  4:37 jim hopper
  2003-03-26  2:53 ` Steve
  0 siblings, 1 reply; 2+ messages in thread
From: jim hopper @ 2003-03-24  4:37 UTC (permalink / raw)


can anyone point me at some examples of how to interfaces an ada tagged
type to a c++ class?  there seem to be several pragmas inside gnat that
seem setup to do this but no examples at all of how to use that that i
have found.

thanks jim



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

* Re: gnat link to c++ classes (all gcc)
  2003-03-24  4:37 gnat link to c++ classes (all gcc) jim hopper
@ 2003-03-26  2:53 ` Steve
  0 siblings, 0 replies; 2+ messages in thread
From: Steve @ 2003-03-26  2:53 UTC (permalink / raw)


Have you tried the GNAT User's Guide?

In Gnat 3.15p the section is:
  2.11.2 Linking a Mixed C++ & Ada Program
And:
  2.11.3 A Simple Example

I have dynamically linked C++ to Ada with a non-gnat compiler, but I've have
done it the hard way.  I create an instance of a tagged type corresponding
to each class, and keep a copy of the "this" pointer for the class in the
tagged type.  On the "C++" side I have extern C functions that are called
from the Ada side and cast the "this" pointer to the appropriate type to
invoke the method.

If anyone wants I could put together a small example.

Steve
(The Duck)

"jim hopper" <hopperj@macconnect.com> wrote in message
news:230320032328356719%hopperj@macconnect.com...
> can anyone point me at some examples of how to interfaces an ada tagged
> type to a c++ class?  there seem to be several pragmas inside gnat that
> seem setup to do this but no examples at all of how to use that that i
> have found.
>
> thanks jim





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

end of thread, other threads:[~2003-03-26  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-24  4:37 gnat link to c++ classes (all gcc) jim hopper
2003-03-26  2:53 ` Steve

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