From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2f51b5a1324ec613 X-Google-Attributes: gid103376,public From: bourguet@my-deja.com Subject: Re: ADA 95 C++ and Solaris Date: 1999/11/22 Message-ID: <81av2u$iaf$1@nnrp1.deja.com>#1/1 X-Deja-AN: 551535604 References: <3831644C.6CFBCA79@animaths.com> X-Http-Proxy: 1.1 sj-netcache (NetCache 4.0R2D6), 1.0 x38.deja.com:80 (Squid/1.1.22) for client 158.140.208.29, 158.140.3.201 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Nov 22 08:32:29 1999 GMT X-MyDeja-Info: XMYDJUIDbourguet Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (X11; I; SunOS 5.5.1 sun4u) Date: 1999-11-22T00:00:00+00:00 List-Id: 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.