Subj : Re: Problem with compiling this code To : borland.public.cpp.borlandcpp From : Scott Wilson Date : Mon Sep 12 2005 01:46 pm Thanks for your help. That makes sense. I seem to remember this from a C++ course I did many moons ago. Cheers, Scott "Thomas Maeder [TeamB]" wrote in message news:m2u0gsrg37.fsf@madbox2.local... > "Scott Wilson" writes: > > > I am having an issue with the compilation of this code (well this is > > the class header where the error is flagging that the problem is): > > > > The Errors: > > Error E2238 FullScreenTitleBar.h 53: Multiple decleration for CTitleBar2 > > Error E2344 FullScreenTitleBar.h 52: Earlier declaration of CTitleBar2 > > [in addition to Ed Mulroy's post:] > > It seems that the definition of class CTitleBar2 is parsed twice for > the same translation unit. This is an error. "#include guards" are > typically used to solve this problem; > > > At the top of the file containing the definition of class > CTitleBar2, add the following two lines > > #if !defined(CTITLEBAR2_H) > #define CTITLEBAR2_H > > , and at the end of this file, add the following line: > > #endif > > > [The symbol defined in the #include guard may vary, but it's a good > idea to make it long and ugly, as all user-defined macro names.] > > > This will cause the compiler to skip the entire contents of that file > when it is #included for the second time for a translation unit. .