comp.lang.ada
 help / color / mirror / Atom feed
* ADA 95 C++ and Solaris
@ 1999-11-16  0:00 Olivier Fourel
  1999-11-20  0:00 ` Simon Wright
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier Fourel @ 1999-11-16  0:00 UTC (permalink / raw)


Hi,
I look for a way to link ADA95 code and C++ code.

 The ADA 95 program is compiled with GNAT 3.11 under Solaris 2.6 on a
 SPARC station
 and I need to call functions written in a C++ library.
 Can anyone help me about this ?







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

* Re: ADA 95 C++ and Solaris
  1999-11-16  0:00 ADA 95 C++ and Solaris Olivier Fourel
@ 1999-11-20  0:00 ` Simon Wright
  1999-11-21  0:00   ` Gisle S�lensminde
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Wright @ 1999-11-20  0:00 UTC (permalink / raw)


Olivier Fourel <olivier.fourel@animaths.com> writes:

> I look for a way to link ADA95 code and C++ code.
> 
>  The ADA 95 program is compiled with GNAT 3.11 under Solaris 2.6 on a
>  SPARC station
>  and I need to call functions written in a C++ library.
>  Can anyone help me about this ?

Your best starting place is probably[1] the documentation[2] for the
3.12p compiler (the 3.11p compiler behaves in the same way, I
believe). Look in the Users Guide for the section "Building mixed Ada
& C++ programs".

[1] At the moment I only have the 3.12a2 documentation here, I expect
it's the same.

[2] From the usual FTP sites .. cs.nyu.edu/pub/gnat etc




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

* Re: ADA 95 C++ and Solaris
  1999-11-20  0:00 ` Simon Wright
@ 1999-11-21  0:00   ` Gisle S�lensminde
  1999-11-22  0:00     ` Robert Dewar
  1999-11-22  0:00     ` bourguet
  0 siblings, 2 replies; 5+ messages in thread
From: Gisle S�lensminde @ 1999-11-21  0:00 UTC (permalink / raw)


In article <x7vpux5oxgd.fsf@pogner.demon.co.uk>, Simon Wright wrote:
>Olivier Fourel <olivier.fourel@animaths.com> writes:
>
>> I look for a way to link ADA95 code and C++ code.
>> 
>>  The ADA 95 program is compiled with GNAT 3.11 under Solaris 2.6 on a
>>  SPARC station
>>  and I need to call functions written in a C++ library.
>>  Can anyone help me about this ?
>
>Your best starting place is probably[1] the documentation[2] for the
>3.12p compiler (the 3.11p compiler behaves in the same way, I
>believe). Look in the Users Guide for the section "Building mixed Ada
>& C++ programs".
>

One comment: Your answer depends that the code is compiled with g++.
If the code is compiled with a different c++ compiler, you can 
generally not expect it to be compatible with neither g++ nor
GNAT c++ interfacing. The reason is that c++ compilers have  
different name mangling schemes. If your library is compiled with say 
Sun CC, you can't link it with GNAT c++ interface. If your library
is i binary form or not is possible to compile with g++, you
must use C conventions from both the Ada and c++ side.

--
Gisle S�lensminde ( gisle@ii.uib.no )   





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

* Re: ADA 95 C++ and Solaris
  1999-11-21  0:00   ` Gisle S�lensminde
  1999-11-22  0:00     ` Robert Dewar
@ 1999-11-22  0:00     ` bourguet
  1 sibling, 0 replies; 5+ messages in thread
From: bourguet @ 1999-11-22  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]

In article <slrn83g0e3.cr.gisle@kondor.ii.uib.no>,
  gisle@kondor.ii.uib.no (Gisle S�lensminde) wrote:
> In article <x7vpux5oxgd.fsf@pogner.demon.co.uk>, Simon Wright wrote:
> >Olivier Fourel <olivier.fourel@animaths.com> writes:
> >
> >> I look for a way to link ADA95 code and C++ code.
> >>
> >>  The ADA 95 program is compiled with GNAT 3.11 under Solaris 2.6 on
a
> >>  SPARC station
> >>  and I need to call functions written in a C++ library.
> >>  Can anyone help me about this ?
> >
> >Your best starting place is probably[1] the documentation[2] for the
> >3.12p compiler (the 3.11p compiler behaves in the same way, I
> >believe). Look in the Users Guide for the section "Building mixed Ada
> >& C++ programs".
> >
>
> One comment: Your answer depends that the code is compiled with g++.
> If the code is compiled with a different c++ compiler, you can
> generally not expect it to be compatible with neither g++ nor
> GNAT c++ interfacing. The reason is that c++ compilers have
> different name mangling schemes. If your library is compiled with say
> Sun CC, you can't link it with GNAT c++ interface. If your library
> is i binary form or not is possible to compile with g++, you
> must use C conventions from both the Ada and c++ side.

Is this the result of your experience in interfacing gnat with C++?
I've never tried nor even intented to link with C++ but from what I
recall from that part of the documentation, the mechanism used by gnat
is generic enough to interface with every C++ compiler. I think for
example that Dec and SGI who deliver Gnat to their customers what it to
interface with their C++ compiler.

Yours,

-- Jean-Marc


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: ADA 95 C++ and Solaris
  1999-11-21  0:00   ` Gisle S�lensminde
@ 1999-11-22  0:00     ` Robert Dewar
  1999-11-22  0:00     ` bourguet
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1999-11-22  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

In article <slrn83g0e3.cr.gisle@kondor.ii.uib.no>,
  gisle@kondor.ii.uib.no (Gisle S�lensminde) wrote:
> If the code is compiled with a different c++ compiler, you can
> generally not expect it to be compatible with neither g++ nor
> GNAT c++ interfacing.

The GNAT c++ interfacing scheme is compiler indepedent, and
specifically designed to be easily tailorable to any C++
compiler. It has been used successfully with the SGI Delta
C++ compiler, which uses quite different name mangling and
data layouts from g++


Sent via Deja.com http://www.deja.com/
Before you buy.




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

end of thread, other threads:[~1999-11-22  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-16  0:00 ADA 95 C++ and Solaris Olivier Fourel
1999-11-20  0:00 ` Simon Wright
1999-11-21  0:00   ` Gisle S�lensminde
1999-11-22  0:00     ` Robert Dewar
1999-11-22  0:00     ` bourguet

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