In article , gisle@kondor.ii.uib.no (Gisle S�lensminde) wrote: > In article , Simon Wright wrote: > >Olivier Fourel 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.