Mail Archives: djgpp/1999/08/06/00:04:58
Hyper <jimb AT snip DOT net> writes:
> Amin Kharchi wrote:
> > First the errors:
> >
> > Error: parse error before '{'
> > Error: parse error before 'public:'
> > Error: parse error before '}'
> >
> > And now the code:
> >
> > class Player
> > {
> > private:
> > int lives;
> >
> > public:
> > void move(void);
> > };
> >
> > Yesterday there not this errors.
If you put your code snippet from above into its own C++ file and compile it
to object code (using gxx -c, for example) I think that you will not get these
errors. There is nothing wrong with the code you have shown us so you had
better show us a more complete section of code (though not the whole program
please) and also tell us what command you are using to compile the code.
My *guess* is that you are trying, inadvertantly, to compile a C++ source file
as plain C. Or maybe you have omitted a semicolon somewhere above this
class declaration.
Good luck,
Ian
--
The views expressed above are those of the writer and do not represent the
views, policy, or understanding of any other person or official body.
- Raw text -