Sketches with #include <Time.h> do not compile

Hi all,

I have a problem that I just cannot solve and any help would be appreciated… I searched the old forums but did not find anything similar to my situation.

I downloaded the Time Library from the Playground and just cannot get any sketches using the library to compile. I followed the installation instuctions and the libraries are installed in
C:\arduino\libraries\Time\DateStrings.cpp
C:\arduino\libraries\Time\Time.cpp
C:\arduino\libraries\Time\Time.h

When I verify one of the example sketches, the compile process runs for a few seconds and terminate with “Error compiling”.
The same thing happens if I just take a simple sketch such as “Blink.pde” and include the time library as #include <Time.h>

I tried putting the files
C:\arduino\libraries\Time\DateStrings.cpp
C:\arduino\libraries\Time\Time.cpp
C:\arduino\libraries\Time\Time.h

in any other directory then the compile just fails with an error such as
---------------------------------------
“TimeSerial.cpp:12:20: error: Time.h: No such file or directory
TimeSerial:16: error: ‘time_t’ does not name a type
TimeSerial.cpp: In function ‘void setup()’:”
---------------------------------------

So it appears that the Time library is where arduino IDE expects it to be.

The problem is that the compile fail even with just a simple #include <Time.h>
So Time.h itself must be problematic??

Any suggestions, ideas?
How can I get the IDE to be more verbose when compiling instead of just saying “Error compiling”?

Running Windows 7 and Arduino0022

Regards
Andre

"PDE" files have been obsolete for a while now.

Latest IDE is 1.8.7 so it looks like you have some quite old software !
Would suggest moving up to at least 1.8.5
All of which will work fine on windows 7.

As for adding Libraries this should help

There was some specific issue with Time.h - the compiler now has a time.h builtin, when there was previously an Arduino library with the same name, and that library had to be renamed to avoid a conflict with the new version of the compiler. Or something like that.

Some searching will get you what you need to know.

I agree it’s time to upgrade; 0022 is antique.

After the upgrade, 3rd party libraries go in C:\Users\yourUserName\Documents\Arduino\libraries. You will need to include TimeLib.h instead of Time.h (for the reason pointed out by DrAzzy).

Beyond being antique, 0022 is missing some important changes and improvements. We're several compiler versions later, so sketches will come out smaller (less flash used), particularly since we got LTO a few versions ago; Link Time Optimization (LTO) is a very aggressive optimization option performed by the linker that typically shrinks compiled sketches by 10-20%!

Plus, there are a few significant fixes to the arduino core libraries (Serial.flush() means something different now I think, print got changed, and String, while still a Bad Thing, doesn't have the memory allocation bug anymore - it still leads to memory fragmentation issues, so it should be used sparingly if at all, but it's usable, which before it wasn't)