From the error output, I suspect it's being run from the command line.

@OP - please post the full text of the command you are using to compile the program, and where the source file is situated.