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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: gisle@kondor.ii.uib.no (Gisle S�lensminde) Subject: Re: ADA 95 C++ and Solaris Date: 1999/11/21 Message-ID: #1/1 X-Deja-AN: 551255792 Content-Transfer-Encoding: 8bit References: <3831644C.6CFBCA79@animaths.com> Organization: University of Bergen, Norway Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-21T00:00:00+00:00 List-Id: 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. -- Gisle S�lensminde ( gisle@ii.uib.no )