Subj : Re: extern "C" To : borland.public.cpp.borlandcpp From : " Bruce Salzman" Date : Wed Oct 15 2003 09:32 am Hello Sebastian, This news group is for the pre-builder compiler, actually. The builder groups all have cppbuilder in their names. But this question really is not builder-specific... From the on-line help's calling convention options: C (Command-line switch: -pc, -p-) This option tells the compiler to generate a C calling sequence for function calls (generate underbars, case sensitive, push parameters right to left). This is the same as declaring all subroutines and functions with the _ _cdecl keyword. Functions declared using the C calling convention can take a variable parameter list (the number of parameters does not need to be fixed). Standard Call (Command-line switch: -ps) This option tells the compiler to generate a Stdcall calling sequence for function calls (does not generate underscores, preserve case, called function pops the stack, and pushes parameters right to left). This is the same as declaring all subroutines and functions with the _ _stdcall keyword. Functions must pass the correct number and type of arguments. They are mutually exclusive, use one or the other. The main differences are the "C" convention adds a leading underscore, preserves the case of the name, and allows a variable number of arguments. Regards, Bruce > 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". > > Please help, > Sebastian .