Article View: gnu.g++.help
Article #192funny behaviour with extern "C" (was: Calling C++ from C)
From: Liz Veitch
Date: Tue, 18 Aug 1992 17:02
Date: Tue, 18 Aug 1992 17:02
44 lines
1478 bytes
1478 bytes
HI,
I have a problem with calling C functions from C++, despite using the
recommended syntax. If I have a test C++ program as follows:
// TEST.CC
extern "C" {
void foo0();
void Foo1();
void FOO2();
}
main ( int argc, char **argv ) {
foo0();
Foo1();
FOO2();
}
then I find that the linker correctly starts looking for foo0 in the
link list, but the functions with capital letters in the name are
treated as if I hadn't used extern "C" :
%LINK-W-NUDFSYMS, 3 undefined symbols:
%LINK-I-UDFSYM, FOO0
%LINK-I-UDFSYM, FOO1_800000X
%LINK-I-UDFSYM, FOO2_E00000X
Has anyone seen this behaviour/feature/bug before? And does anyone know
how to make it behave properly?
Help! I'm really stuck, because what I really want to do is add some
Motif stuff, and who ever heard of a Motif function without capitals in
the name? There must be some way to stop this happening. ( I'm using
GNU 2.2.2 on VAX/VMS. )
Thanks in advance,
Liz Veitch
Technical Details
Message-ID:
<18AUG199218022036@vxcrna.cern.ch>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!dxcern!vxcrna.cern.ch!veitchShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.help Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!dxcern!vxcrna.cern.ch!veitch From: veitch@vxcrna.cern.ch (Liz Veitch) Subject: funny behaviour with extern "C" (was: Calling C++ from C) Message-ID: <18AUG199218022036@vxcrna.cern.ch> News-Software: VAX/VMS VNEWS 1.41 Keywords: extern "C" Sender: news@dxcern.cern.ch (USENET News System) Organization: European Organization for Nuclear Research, CERN Date: Tue, 18 Aug 1992 17:02:00 GMT Lines: 45