From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,55c1a59b43112bcb X-Google-Attributes: gidfee84,public From: amartin@denton.zko.dec.com (Alan H. Martin) Subject: Re: question on getting mangled names using 'nm' Date: 1995/12/10 Message-ID: <4aeqhn$k5j@zk2nws.zko.dec.com>#1/1 X-Deja-AN: 121471528 references: organization: DEC keywords: mangle c++ newsgroups: comp.unix.osf.osf1 In article scott@hakuin.boeing.com writes: >I am using the DEC-Alpha C++ compiler and need to connect the code >to other non c++ tools, such as C and Ada. Unfortunately >I don't know the name of the externals in the C++ code, ... On any platform, if you want a C++ routine named a_proc to be callable from other languages like C, then unless you need function overloading or want type-safe linkage, don't declare it like this: a_proc() { ... } declare it using a linkage specification like this: extern "C" a_proc() { ... } -or- extern "C" { a_proc() { ... } } >... and my use of the unix 'nm' tool isn't helping. It seems to print a >pretty name instead of the mangled name. If you want nm to print C++ mangled names, feed it one of the switches -mangled_name_only or -mangled_name_also. /AHM -- Alan Howard Martin AMartin@TLE.ENet.DEC.Com