Cannot compile code from Arduino WIFI shield example I'm trying to launch the piece of code in this Wifi example:
https://www.arduino.cc/en/Reference/WiFiConfig
via Arduino.cc online editor, but I'm getting those errors:

/home/ubuntu/opt/libraries/latest/wifinina_1_2_0/src/utility/spi_drv.cpp:87:24: error: 'PINS_COUNT' was not declared in this scope


and

/home/ubuntu/opt/libraries/latest/wifinina_1_2_0/src/utility/spi_drv.cpp:97:15: error: 'NINA_GPIO0' was not declared in this scope


Do someone has an idea of how to solve this?
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.