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-7-bit X-Google-Thread: 103376,31c633ee5da73ed9 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Ada and C++; Any Gurus Out There? Date: 1999/06/02 Message-ID: <375574F7.501CDFB9@averstar.com>#1/1 X-Deja-AN: 484955507 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-02T00:00:00+00:00 List-Id: Decker, Christian R wrote: > ... > > Now, I know one can declare the C++ function as 'extern "C" blah blah' but > this really is a work around and not a > solution. I am looking for a way to simply link Ada and C++ object files > such that no modifcations need to > be made to the C++ code. I also would like to only have to mess with the > Ada code or Ada compiler/linker > options id possible. Few if any Ada compilers understand the mangling gyrations of the typical C++ compiler. Hence you need to use extern "C". You don't need to modify the existing C++ code to do this. You could write an interfacing layer in C++ that uses extern "C" for what it exports to Ada (or C), and contains calls to the existing C++ routines of interest. Also, if there is no overloading in the C++ header file, you can rename the existing C++ header, create a new one with the old name, consisting simply of: extern "C" { #include "renamed_header.h" } > ... > Thanks! > Chris -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA