This is caused by not having downloaded the full sketch. The Arduino IoT Cloud editor only shows the primary sketch file, but there are two additional files hidden away:
thingProperties.h - contains the setup code generated by Arduino IoT Cloud when you created your Thing.
arduino_secrets.h - the definitions for your network credentials.
These files are essential for your Thing sketch to work, so if you only download the contents of the "cloud_test_issue" file, then you will get an error like this.
Here is how you can get your full Thing sketch from Arduino Cloud:
- Open your Thing in Arduino IoT Cloud.
- Click the "Sketch" tab.
- Click the "Open full editor" button.
- Click the ⬤⬤⬤ icon on the right side of the board and port selector.
- From the dropdown menu, select "Download Sketch".
- Wait for the download to finish.
- Open the folder the sketch was downloaded to.
- Unzip the downloaded
- Open the sketch from that unzipped folder.
- Click the "arduino_secrets.h" tab.
- Enter your network credentials.
You should now be able to compile and upload the Thing sketch