简体   繁体   English

Arduino IDE在Windows中找不到sys / time.h

[英]Arduino IDE doesn't find sys/time.h in Windows

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. 我正在尝试按照本教程开始测试我的新Adafruit Azure IoT入门套件,该套件随附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: 我能够在Windows 10的PC上设置Arduino IDE 1.8.4(来自Windows Store)。在步骤1.8(构建远程监控示例)中,当我尝试编译解决方案“ remote_monitoring.ino” dowonload时从这里开始 ,出现以下错误:

C:\\iot-hub-c-m0wifi-getstartedkit-master\\remote_monitoring\\remote_monitoring.ino:12:22: fatal error: sys/time.h: No such file or directory C:\\ iot-hub-c-m0wifi-getstartedkit-master \\ remote_monitoring \\ remote_monitoring.ino:12:22:致命错误:sys / time.h:没有这样的文件或目录

#include <sys/time.h>

compilation terminated. 编译终止。

exit status 1 Error compiling for board Arduino/Genuino Uno. 退出状态1为板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: 看起来在Windows中,包括sys / time.h都行不通,但是如果我尝试删除sys /部分,则会出现以下错误:

C:\\Users\\jonguz\\OneDrive - Microsoft\\Documents\\Arduino\\libraries\\AzureIoTHub\\src/sdk/serializer.h:42:19: fatal error: cstdlib: No such file or directory C:\\ Users \\ jonguz \\ OneDrive-Microsoft \\ Documents \\ Arduino \\ libraries \\ AzureIoTHub \\ src / sdk / serializer.h:42:19:致命错误:cstdlib:没有这样的文件或目录

#include <cstdlib>

I appreciate your help. 我感谢您的帮助。

sys/time.h and cstdlib are located in the toolchain used by the Adafruit SAMD Boards hardware package (specifically arm-none-eabi-gcc). sys / time.h和cstdlib位于Adafruit SAMD Boards硬件软件包(特别是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 : 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) 羽毛M0(适用于Express以外的任何羽毛M0)

So the solution is to select Tools > Board > Adafruit Feather M0 after installing Adafruit SAMD Boards via Boards Manager but before compiling the sketch. 因此,解决方案是在通过Boards Manager安装Adafruit SAMD板之后但在编译草图之前,选择“工具”>“板”>“ Adafruit Feather M0”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM