That's not really an error. g++ defaults to C++98 mode in versions prior to 6.1. The for syntax you're using isn't part of the C++98 standard.
If you want to run a different standard, you have lots of options:
- Upgrade g++ to version 6.1 or later on Jobe, if this is available for the version of Linux that the Jobe server is running.
- Change the default compile options for g++ within Jobe to whichever standard you wish to teach. For example, you might wish to add the compile option -std=c++11. The compile options for C++ are set in the file <jobe_home>/application/libraries/cpp_task.php.
- Change the compile options in the CodeRunner language prototype(s) you're using by entering a JSON string like {"compileargs": ["-std=c++11"]} into the sandbox parameters, which are in the Advanced Customisation section of the author's form. This is documented in the on-line help.
- Define new question prototypes for C++ that select your preferred mode, as in (3).
- Customise just the questions in which you wish to allow the non-default behaviour, as in (3).
My preference is (4) but you need to understand question prototypes properly if you're going to attempt that.
Richard