Subj : Re: Upgrade project from Turbo C++ 3.0 to Borland C++ 5.02 To : borland.public.cpp.borlandcpp From : "Ed Mulroy [TeamB]" Date : Mon Mar 01 2004 03:01 pm Pull stdlib.h up in your editor. You will see that it already has extern "C" style guards and is correct for use as either of C or C++. By encasing the include in an extern "C" block you have subverted those guards and caused the header file to be improperly handled. Changing from encasing your header files that contain includes for compiler supplied headers in extern "C" blocks to placing the extern "C" block in the header file itself. For instance: ----------------- #if !defined(IOLIB_H) #define IOLIB_H #include ---stuff--- #if defined(__cplusplus) extern "C" { --stuff that needs the extern "C"--- } #endif --other stuff--- #endif ----------------- That should be the same as is needed under TC++ 3.0. Later requirements of the C++ language did move some things around in header files so may be the reason you did not have a problem doing it your way with TC++. .. Ed > Bryan Barton wrote in message > news:40439391$1@newsgroups.borland.com... > > I am attempting to upgrade a C++ project from TC++ 3.0 to > BC++ 5.02 and I get the following error: > > stdlib.h(630,19): Templates and overloaded operators cannot > have C linkage. > > Previously in my TC++ 3.0 project I basically wrapped all my > C-library include directives with: > > extern "C" > { > #include "iolib.h" > #include "commlib.h" > } > > The TC++ project has always built correctly, but now I get this > new error. I am assuming it's because the iolib.h file has the > line #include . It didn't cause errors in the TC++ > complier, are there big enough changes to the stdlib that would > create such an error in the BC++ compiler? ... .