I think that the problem is here:
void main();
The semicolon in C tells to the compiler that a
statement[
^] is complete.
In this case we are defining the function 'main' which is a declaration
Compound statement[
^].
Closing such a declaration before the body is an error. The correct code is:
void main()
{
... }
For sake of completeness I would add that closing before body some other compound statement, where the body is not mandatory, is not an error.
I.e. a while, a for, etc.
for (i=0; i<10; i++)
;
This coulld be write also as:
for (i=0; i<10; i++);