0
votes

I'm trying to follow this tutorial to start testing my new Adafruit Azure IoT starter Kit that comes with an Arduino Feather M0 Wifi. I was able to setup the Arduino IDE 1.8.4 (From Windows Store) on my PC which is a Windows 10. In the step 1.8 (Build Your Remote Monitoring Sample), when I try to compile the solution "remote_monitoring.ino" dowonload from here, it appears the following error:

C:\iot-hub-c-m0wifi-getstartedkit-master\remote_monitoring\remote_monitoring.ino:12:22: fatal error: sys/time.h: No such file or directory

#include <sys/time.h>

compilation terminated.

exit status 1 Error compiling for board Arduino/Genuino Uno.

It seems like in Windows, including sys/time.h just doesn't Works, but if I try to delete the sys/ part, it comes the following error:

C:\Users\jonguz\OneDrive - Microsoft\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:42:19: fatal error: cstdlib: No such file or directory

#include <cstdlib>

I appreciate your help.

1
Which board do you have selected from the Tools > Board menu?per1234
Thanks for your tip!, it was exactly that, I have not choose the board! :-)Jonathan Guzman Lemos
Glad it's working for you now! I have written an answer just so this question can have an official resolution instead of only some comments.per1234

1 Answers

0
votes

sys/time.h and cstdlib are located in the toolchain used by the Adafruit SAMD Boards hardware package (specifically arm-none-eabi-gcc). The files in this tool are only added to the include search path when a board that uses that tool is selected in the Tools > Board menu. If you don't have one of those boards selected then the file will not be found, thus the error messages you encountered.

From https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-with-arduino-ide:

Select the matching board, the current options are:

  • Feather M0 (for use with any Feather M0 other than the Express)

So the solution is to select Tools > Board > Adafruit Feather M0 after installing Adafruit SAMD Boards via Boards Manager but before compiling the sketch.