70a Subj : Re: extern "C" To : borland.public.cpp.borlandcpp From : "Sebastian Gantzert" Date : Wed Oct 15 2003 09:25 pm Thanks, the version with #ifdef __cplusplus works fine. Next time I will post to the 'cppbuilder' newsgroup. Thought it would be a general c/c++ question. "Ed Mulroy [TeamB]" schrieb im Newsbeitrag news:3f8d51da$1@newsgroups.borland.com... > Check if this works: > > ------------------------- > extern "C" { > void __stdcall test1(void); > void __stdcall test2(); > } > ------------------------- > > However header files have a way of being used in both C and C++ programs so > the following might be a better way: > > ------------------------- > #ifdef __cplusplus > extern "C" { > #endif > > void __stdcall test1(void); > void __stdcall test2(); > > #ifdef __cplusplus > } > #endif > ------------------------- > > Mr Salzman is correct. This is the newsgroup for the old Borland C++ > compiler. Please post C++ Builder questions in C++ Builder groups, groups > with the word 'cppbuilder' in their name. > > . Ed > > > Sebastian Gantzert wrote in message > > news:3f8d47b5@newsgroups.borland.com... > > > > BCB5. Service Pack 1. > > > > Hi. I want to write a header-file importing a function > > from somewhere else. > > > > What's wrong with these lines of code > > > > extern "C" void __stdcall test1(void); > > extern "C" void __stdcall test2(); > > > > so that the following error occurs: > > C++ Error: E2040 Declaration terminated incorrectly. > > > > The following lines are correctly parsed: > > extern void __stdcall test1(void); > > extern void __stdcall test2(); > > > > But I need extern "C". > > . 0