fatal error: Time.h: No such file or directory compilation terminated.
lwh456789 opened this issue · 28 comments
为什么会出现这种情况,该怎么解决
fatal error: Time.h: No such file or directory
compilation terminated.
D:\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10603 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -ID:\Arduino\hardware\arduino\avr\cores\arduino -ID:\Arduino\hardware\arduino\avr\variants\mega C:\Users\ADMINI1\AppData\Local\Temp\build789388500709334239.tmp\mqtt_basic_pub_and_sub.cpp -o C:\Users\ADMINI1\AppData\Local\Temp\build789388500709334239.tmp\mqtt_basic_pub_and_sub.cpp.o
Hi, make sure that you have installed all the dependencies, like time.h from Arduino: https://playground.arduino.cc/Code/Time/
https://github.com/PaulStoffregen/Time
Be attentive to the hierarchy of folders when installing the dependencies.
Unzip all folders in your Arduino libraries folder, then set in the "tools" menu -> board 2560 option.
try the sketch in "example" folder.
Please, if possible write in English, hope i helped you.
为什么会出现这种情况,该怎么解决
fatal error: Time.h: No such file or directory
compilation terminated.
I replaced the original time.h with the new one that you provided me, but the original problem still appeared after compiling, and # include <Time. h >; delete, the problem after compilation is
fatal error: sim800Client.h: No such file or directory compilation terminated.
#include <Time.h> #include <sim800Client.h> #include <PubSubClientHotlog.h> #include <TimeAlarms.h>
I wonder if the problem is the Arduino version. Mine is 1.6.3
I wonder if the problem is the Arduino version. Mine is 1.6.3
This look like a problem with the Arduino installation or compiler, just to verify, you must have this folder organization:
windows:
C:\Documents\Arduino\libraries\ < paste here the sim800, TimeAlarms, Time-Master, PubSub >
and
C:\Program Files (x86)\Arduino\libraries\ < paste here the sim800, TimeAlarms, Time-Master, PubSub >
I have tested to your Arduino version(1.6.3) and the sketch runs normally
What is your operational system?
win7 64
I'm using the program our friend here providedhttps://github.com/Gabriellavoura/Mqtt-and-Sim800-900/tree/master/GPRS%20with%20MQTT%20for%20Sim800and900/Example/mqtt_basic_pub_and_sub
I'm using the program our friend here providedhttps://github.com/Gabriellavoura/Mqtt-and-Sim800-900/tree/master/GPRS%20with%20MQTT%20for%20Sim800and900/Example/mqtt_basic_pub_and_sub
Ok, please verify if in your Arduino IDE this is showing:
You must have this, if not probably you installation of Arduino IDE is wrong
Can you compile it successfully
Maybe I should try downloading the Arduino again
Maybe I should try downloading the Arduino again
Please try rename #include <Time.h>
to #include <TimeLib.h>
Searching here for a solution, i found that some win versions ignores the CamelCase notation, and cause conflict with time.h from C with Time.h from Arduino.
I've now re-downloaded the latest version of Arduino, and when I re-added libraries, it said it was invalid
what should I do?
I've already added this, but the file is not shown in the example
I've already added this, but the file is not shown in the example
After put just the content of "GPRS with MQTT for Sim800and900" on your documents/Arduino/libraries/
Open the sketch manually, on IDE Arduino go to File -> Open - > Examples -> Mqtt_basic_pub_and_sub -> mqtt_basic_pub_and_sub.ino
That's exactly what I did, but only four other folders appear in the Example, and the Example folder doesn't appear
What are the common reasons for invalid libraries
That's exactly what I did, but only four other folders appear in the Example, and the Example folder doesn't appear
Try opening the sketch manually.
What are the common reasons for invalid libraries
Wrong paths 😢 . That is strange, because i have done the same things here in my computer, and that is ok.
That's exactly what I did, but only four other folders appear in the Example, and the Example folder doesn't appear
After change, always restart your Arduino IDE. Don’t forget this, as it doesn’t automatically detect changes in the file architecture.
Thank you, my friend. I've compiled it. Thank you for your guidance
Thank you, my friend. I've compiled it. Thank you for your guidance
I will work to update this project soon as possible, now I'm going to sleep, is 6 Am here in Brazil.
If you have any issue please leave a commt.
Happy for you, You are welcome! 😄