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,8a1ccfd6a7ff0dd0 X-Google-Attributes: gid103376,public From: jsa@organon.com (Jon S Anthony) Subject: Re: Ada and Mesa Date: 1996/06/12 Message-ID: #1/1 X-Deja-AN: 159863057 sender: news@organon.com (news) references: <4pkset$cgv@ss2.cs.mci.com> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-06-12T00:00:00+00:00 List-Id: In article <4pkset$cgv@ss2.cs.mci.com> James_Rogers writes: > Linking to existing C object files is somewhat easier than linking > to existing C++ object files. C++ is more difficult due to the > symbol name mangling produced so commonly by C++ compilers. If you > understand how to navigate the symbol mangling for your compiler > then calling the function from Ada is easy. This is just as true for C (or anything else) as Ada. To interface C++ to C (with C call into C++) you need to extern C the C++ stuff to which you want access (whether from Ada or C). This will keep the name mangling at bay and you can use standard import pragmas. > If you do not understand how to navigate the symbol name mangling > you will have great difficulty. No matter what you are using. > The Ada compiler simply needs to know that the > library object being called is a "C" type object, and its correct > library name. The C++ symbol mangling causes that correct library > name to be unexpectedly complex. I haven't had a chance to look at how GNAT gets around this issue. Anyone have an elevator version of how ACT solves this problem? /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com