This problem was most likely caused by the original make
compilation settings in the Appliance. A simple update50
command fixed it, as the poster noted in a comment to the original post.
The for
loop syntax that we learn in CS50, an example of which is included below, is defined in the C99 standard for the C programming language.
for (int i = 0; i < 10; i++;);
The older C89 standard required the variable declaration int i;
to be done outside the for
loop, as below.
int i;
for (i = 0; i < 10; i++;)
The Clang compiler adheres to the old C89 standard by default, unless -C99
is specified as an option, and will emit an error if it encounters C99 syntax in a C file.
update50
and try again. Do you still get the error?