Mail Archives: djgpp/2000/01/06/05:58:54
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.
- Raw text -