Article View: gnu.gcc.help
Article #52780Re: linking a g++-compiled C++ fun
From: Marc Van-Woerkom
Date: Fri, 15 May 1992 23:34
Date: Fri, 15 May 1992 23:34
17 lines
1025 bytes
1025 bytes
A frequent question.
eu> Adding "extern void foo_test(void);" to the C header files and linking
Close. You must use
extern "C"
to get proper linkage with C Module. Without "C" the default is "C++".
(Refer page 524 of the C++PL2 from Stroustrup)
The reason for this is that C++ Compilers use different internal names
to distinguish e.g. between overloaded functions of the same name but
different arguments. This is called "name mangling".
Bye, Marc
Technical Details
Message-ID:
<A1998@AC.maus.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uniol!hb.maus.de!ac.maus.de!Marc_Van-WoerkomReferences:
<A23565@HB.maus.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,ff33e14c6a20c0b,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-05-19 17:24:17 PST Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uniol!hb.maus.de!ac.maus.de!Marc_Van-Woerkom From: Marc_Van-Woerkom@ac.maus.de (Marc Van-Woerkom) Newsgroups: gnu.gcc.help Subject: Re: linking a g++-compiled C++ fun Message-ID: <A1998@AC.maus.de> Date: Fri, 15 May 92 23:34:00 GMT References: <A23565@HB.maus.de> Organization: MausNet Lines: 17 X-Gateway: MausGate/News 1.06