Go Down

Topic: Time library example not compiling (Read 1 time) previous topic - next topic

Spock6

Hello everyone,

I am new with the Arduinio, but I am working with an Arduino Uno and I am using a Mac OSX computer to do my programs.

Recently I tried to install the time library from the following place:
http://playground.arduino.cc/Code/Time

However, after importing the library, I opened and compiling the TimeSerial example, and got the following errors:

Code: [Select]

TimeSerial:24: error: 'time_t' does not name a type
TimeSerial.pde: In function 'void setup()':
TimeSerial:20: error: 'requestSync' was not declared in this scope
TimeSerial:20: error: 'setSyncProvider' was not declared in this scope
TimeSerial.pde: In function 'void loop()':
TimeSerial:29: error: 'timeStatus' was not declared in this scope
TimeSerial:29: error: 'timeNotSet' was not declared in this scope
TimeSerial:31: error: 'timeSet' was not declared in this scope
TimeSerial.pde: In function 'void digitalClockDisplay()':
TimeSerial:39: error: 'hour' was not declared in this scope
TimeSerial:40: error: 'minute' was not declared in this scope
TimeSerial:41: error: 'second' was not declared in this scope
TimeSerial:43: error: 'day' was not declared in this scope
TimeSerial:45: error: 'month' was not declared in this scope
TimeSerial:47: error: 'year' was not declared in this scope
TimeSerial.pde: In function 'void processSyncMessage()':
TimeSerial:65: error: 'time_t' was not declared in this scope
TimeSerial:65: error: expected `;' before 'pctime'
TimeSerial:69: error: 'pctime' was not declared in this scope
TimeSerial:72: error: 'pctime' was not declared in this scope
TimeSerial:72: error: 'setTime' was not declared in this scope
TimeSerial.pde: At global scope:
TimeSerial:77: error: 'time_t' does not name a type


I have looked at the other forums:
http://forum.arduino.cc/index.php?topic=50138.0
http://forum.arduino.cc/index.php/topic,38158.0.html
http://forum.arduino.cc/index.php?topic=93656.0

I went through the suggestions on the fixes and made sure that the Time folder is in my libraries directory and that I am including Time.h with a capital T. However, the issue still persists.

So does anyone have any suggestions, I would greatly appreciate it. Thank you in advanced.

BijendraSingh

your library is not added properly.
1> first remove previously added Time.h, by deleting from arduino libraries.
2>  unzip Time.h library.
3> open Time.h library folder and make sure that there is not more than one sub folder.
4> now add your library in arduino using    sketch->import library->add library.
5> it show library is added in lower section of ide.
6> restart the ide.
7> open any example using  file->example->time->example
8> now compile it.
9> if again it shows list of errors. then  import the library from your sketch folder.
    Time.h is found in lower part of your library list. add it.
10> after adding  #include<Time.h> will be appear on top of your example sketch, (if <Time.h> not appear on top it means that                        your library is not added.)
    now compile again.
     
Bijendra

Spock6

Thank you for the help.

I ended up unzipping the Time.zip file and just copying the three subdirectories DS1307RTC, Time, and TImeAlarm directly into my libraries directory and that fixed the problem when I restarted the IDE.

Thanks again for the help.

Go Up