Subj : Re: extern "C" To : borland.public.cpp.borlandcpp From : "Ed Mulroy [TeamB]" Date : Wed Oct 15 2003 10:55 am 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". .