time.h compiling error

A sketch which previously was working fine now will not compile. The problem seemed to develop after I accepted a board update. The message say that the time.h file is missing from DSRTC1307 library. I have tried re-installing the library to not avail. Here is the error code:

Arduino: 1.6.9 Hourly Build 2016/03/25 02:33 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Arduino\arduino-nightly-windows\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware "C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware" -tools "C:\Arduino\arduino-nightly-windows\arduino-nightly\tools-builder" -tools "C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr" -built-in-libraries "C:\Arduino\arduino-nightly-windows\arduino-nightly\libraries" -libraries "C:\Users\Peter\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10609 -build-path "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Arduino\Programs\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts3_25_2016\water_time_encoder_with_interrupts3_25_2016.ino"
C:\Arduino\arduino-nightly-windows\arduino-nightly\arduino-builder -compile -logger=machine -hardware "C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware" -tools "C:\Arduino\arduino-nightly-windows\arduino-nightly\tools-builder" -tools "C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr" -built-in-libraries "C:\Arduino\arduino-nightly-windows\arduino-nightly\libraries" -libraries "C:\Users\Peter\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10609 -build-path "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Arduino\Programs\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts3_25_2016\water_time_encoder_with_interrupts3_25_2016.ino"
"C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\cores\arduino" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\variants\standard" "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\sketch\water_time_encoder_with_interrupts3_25_2016.ino.cpp" -o "nul"
"C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\cores\arduino" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\variants\standard" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src" "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\sketch\water_time_encoder_with_interrupts3_25_2016.ino.cpp" -o "nul"
"C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\cores\arduino" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\variants\standard" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\libraries\LiquidCrystal\src" "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\sketch\water_time_encoder_with_interrupts3_25_2016.ino.cpp" -o "nul"
"C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\cores\arduino" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\variants\standard" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\libraries\LiquidCrystal\src" "-IC:\Users\Peter\Documents\Arduino\libraries\DS1307RTC" "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\sketch\water_time_encoder_with_interrupts3_25_2016.ino.cpp" -o "nul"
"C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\cores\arduino" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\variants\standard" "-IC:\Users\Peter\Documents\Arduino\libraries\DS1307RTC" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src" "-IC:\Arduino\arduino-nightly-windows\arduino-nightly\libraries\LiquidCrystal\src" "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\sketch\water_time_encoder_with_interrupts3_25_2016.ino.cpp" -o "C:\Users\Peter\AppData\Local\Temp\buildc293066c561aa1229aad7544a71f1eef.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
In file included from C:\Arduino\Programs\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts2_28_2016\water_time_encoder_with_interrupts3_25_2016\water_time_encoder_with_interrupts3_25_2016.ino:6:0:

C:\Users\Peter\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:9:18: fatal error: Time.h: No such file or directory

#include <Time.h>

^

compilation terminated.

Using library Wire at version 1.0 in folder: C:\Arduino\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire
Using library LiquidCrystal at version 1.0.5 in folder: C:\Arduino\arduino-nightly-windows\arduino-nightly\libraries\LiquidCrystal
Using library DS1307RTC at version 1.4 in folder: C:\Users\Peter\Documents\Arduino\libraries\DS1307RTC
exit status 1
Error compiling for board Arduino/Genuino Uno.

I am running the current IDE version on Windows 10.

Thanks for your help!

Peter

Hi,
Try an earlier version of the IDE.

Tom.... :slight_smile:

No go...I am still getting the time.h error:

C:\Users\Peter\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:9:18: fatal error: Time.h: No such file or directory
#include <Time.h>

The DS1307RTC library is installed. It must be an old version. How can I get a current version?

This is on IDE 1.6.5, which worked previously!

Peter

I did a work around by not using DSRTC1307 library and removing code that accessed it, which was unnecessary. Still does not explain why it stopped working!

PABresler:
The message say that the time.h file is missing from DSRTC1307 library. I have tried re-installing the library to not avail.

"Time.h" is not a part of the "DS1307RTC" library. "Time" is a separate library that must be installed for the "DS1307RTC" library to work. ("Time.h" is included from "DS1307RTC.h", but not included in that library.)
Check in your sketchbook "libraries" folder for the "Time" library. If it's not there, you might need to download and install it.

Edit: I just saw that you've now removed "DS1307RTC" from your sketch, but thought I'd still post this anyway since I'd already typed it.

TomGeorge:
Hi,
Try an earlier version of the IDE.

Tom.... :slight_smile:

How is that going to make a missing header file magically appear?

Thanks! I will try that. I would prefer to be using the code with the DS1307RTC.

Hi,

How is that going to make a missing header file magically appear?

Time.h doesn't have to be in every library of every version.
And OP said..

A sketch which previously was working fine now will not compile.

So WAS working..

Tom.... :slight_smile:
Thats my thinking ...

TomGeorge:
Hi,Time.h doesn't have to be in every library of every version.
And OP said..So WAS working..

Tom.... :slight_smile:
Thats my thinking ...

Neither "DS1307RTC" nor "Time" are included with the IDE, and must be separately downloaded, so installing an earlier version of the IDE is/was unlikely to fix the problem.

My thought was that possibly after originally installing V1.6.5, Peter might have accidentally installed the "Time" library in the IDE's main "libraries" folder, instead of the one in "Sketchbook", so that it was removed when he uninstalled to update to V1.6.9 hourly.
That also explains why re-installing V1.6.5 didn't cure the problem. My guess is that "DS1307RTC" was correctly installed in the "Sketchbook/libraries" folder, so it wasn't removed during the upgrade, only "Time".
(Of course, this is largely guesswork. :slight_smile: )