Mail Archives: djgpp/2000/01/06/09:07:49
In article <3873FF7B DOT DFB48EA2 AT wt DOT net>, Aaron Chernosky <chernobl AT wt DOT net> wrote:
>I have a header file with a class declaration in it, for ex this:
>
Did you try to compile this? On my system it compiles without complaints (if
you change the inlcude to include). What you are doing here is legal, but
really bad style. You should never include a source file, always include the
header files!
Btw: Which compiler are you using? Since when does gcc say "Error:" when it
encounters an error?
>-- 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?
>
>
>Aaron C
--
Manni
- Raw text -