Date: Thu, 6 Jan 2000 14:57:09 +0500 (MVT) From: Prashant TR To: Aaron Chernosky cc: djgpp AT delorie DOT com Subject: Re: C++, Multiple Files, Classes In-Reply-To: <00010614263100.00523@yahoo> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 5 Jan 2000, Aaron Chernosky wrote: > I have a header file with a class declaration in it, for ex this: > > -- header.h -- > > class MyClass { > public: > MyClass(); > ~MyClass(); > }; > > #inlcude "header.cpp" > > -- header.cpp -- > > MyClass::MyClass() { } > > MyClass::~MyClass() { } > > ---------------- > > When I include the header file into my main program and try to compile > it, the error "Error: syntax error before '::'" numerous times, once for > each function that's in the class. What is causing this? You are probably trying to include header.cpp from header.cpp itself! Prashant --------------------------------------------------- One pound of learning requires ten pounds of common sense to apply it.