Error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'

I am quite new to Arduino but this sketch does work on the downloadable platform. Just curious why it doesn't on the IoT one.