comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Help interfacing Ada and C++
Date: 1997/06/14
Date: 1997-06-14T00:00:00+00:00	[thread overview]
Message-ID: <dewar.866335122@merv> (raw)
In-Reply-To: 33A28715.1558@codenet.net


Charlie says

<<I have a need to interface Ada95 (specifically Gnat) with C++ (SPARC),
and am having some difficulty with it.  I have read all the Gnat docs
and everything seems to work OK, except when I #include <iostream.h>
in the C++ code and try to use anything like "cout".  The Gnat linker
complains about an undefined symbol.  If I #include <stdio.h> and use
printf, everything works OK.  Now, however I need to use cout and
other things in the iostream.h and fstream.h.  I have used the
"with Interfaces.CPP" in the Ada code, but it does not seem to make
a difference.  Are there any other libraries that I need to include
when linking with Gnat?  Any help with this, or a pointer to more
information would be greatly appreciated.>>


YOu need to have all the correct CPP pragmas in your code, not something
that is easy to do by hand (for example, you need to know the proper mangled
names for all the C++ routines you want to call -- probably you did not do
that properly by the sound of it). Try asking this question on that 
chat@gnat.com list, maybe someone there can help you. We do have at least
one customer who has successfully interfaced GNAT and C++ on Solaris.

Robert Dewar
Ada Core Technologies





  reply	other threads:[~1997-06-14  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-14  0:00 Help interfacing Ada and C++ Charlie Gage
1997-06-14  0:00 ` Robert Dewar [this message]
1997-06-15  0:00 ` Jerry van Dijk
1997-06-26  0:00 ` rou271
replies disabled

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