Go Down

Topic: Newb - Trouble Installing Libraries (Read 326 times) previous topic - next topic

Need_Aspirin

I'm new to Arduino.
I am trying to install a library (Time.h).
I'm following this > http://arduino.cc/en/Guide/Libraries
No matter where I put the files...
Example:
Documents/Arduino/libraries/Time/Time.cpp
Documents/Arduino/libraries/Time/Time.h

I get this error when I try and compile:  'time_t' does not name a type

What am I not doing correctly?

Here's my code (Partial)

#include <Time.h>

const int button1Pin = 2;
const int ledPin =  13;
time_t t = now(); // Store the current time in time variable t
...

Thanks! Robert

Nick Gammon

Did you restart the IDE after moving the files?
http://www.gammon.com.au/electronics

Need_Aspirin

Hi Nick! Thanks for responding. I did (Restart the IDE - Mac). I still get the same " 'time_t' does not name a type" error when I compile.

Need_Aspirin

Ok... It complies now. Reason? I copied the files to Documents/libraries/Time and then restarted. In my last post the files were in their original location after being downloaded. So... It looks like your advice (Nick) worked. Now lets see if I can code against the library... Stay tuned ;>

Go Up