Cannot compile code from Arduino WIFI shield example
Those kinds of errors are usually caused by the selection of an incorrect hardware in the IDE.

Choosing a correct board in the IDE will solve the compilation issue.

Since you said that you used the Arduino.cc online editor, I pasted your code into the editor.

You did not say which Arduino board or which WiFi module you are using, so I chose Arduino Uno WiFi board as a starting point.

Compiling the code produced the same errors as in the post.

Next I chose Arduino Uno WiFi Rev2 board, and compiled without errors.