[solved] Problem associated with libraries not being included

The problem I’m having is that the library I’m trying to include isn’t working. In particular, I"m trying to get the Time library to load. I’ve attempted including other, preinstalled, libraries without any troubles,but the time one keeps coming back with the error “No such file or directory.” The time library was added to my libraries as per the instructions on the site, but when I try to import it, it just gives me an empty line. So I added in the required code myself

#include <Time.h>

I even tried to run some of the examples from the downloaded zips, the ones designed to show you how to use different aspects of the libraries, and I’m getting the same error message. I believe this is some sort of installation error, but I can’t figure it out. I know this isn’t a typical programming question, but none of the other forums fit the bill for what I think the problem is, and I figure I can at least get some troubleshooting advice here to figure out what’s going on. Thanks for any help!

Try changing the < and > to inverted commas.

you could try KenF’s solution, but <> should be right
<> looks first in library dirs and “” looks first in the project dir (" they both check the same dirs but the order is different ")
(http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename)

i’ve got a couple of questions:

  • You installed it according the instructions, do you mean the manual instructions or the automatic ones? (Sketch > Import Library > Add Library)
  • When you look under (Sketch > Import Library) do you see the Time library listed there?
  • When you look under (File > Examples) do you see the Time listed? ( and the Examples under it? )

couple quick answers:

KenF:
Try changing the < and > to inverted commas.

I got this from trying ‘Time.h’
error: #include expects “FILENAME” or
Tried it with the “Time.h” and got the same problem as before

laurencemommers:

  • You installed it according the instructions, do you mean the manual instructions or the automatic ones? (Sketch > Import Library > Add Library)
  • When you look under (Sketch > Import Library) do you see the Time library listed there?
  • When you look under (File > Examples) do you see the Time listed? ( and the Examples under it? )

In order, installed according to automatic, yes it’s visible in the Import Library, yes it’s visible in Examples.
Ironically, you did just teach me how to access the Examples in a different way than I did before, so thanks :smiley:
Lastly, I tried using “” versus <> in response to Ken, got the same error as before where it says there’s no such file

Thanks for the help, though

laurencemommers:
you could try KenF’s solution, but <> should be right
<> looks first in library dirs and “” looks first in the project dir (" they both check the same dirs but the order is different ")

Just did a quick test by inventing a test library and put it in my sketch libraries directory. Using inverted commas or <> made no difference. It gets found with either. So it seems that the OPs library simply hasn’t been installed in the correct directory.

BTW I’ve never tried the “Import library” option. Sounds like it might have problems. It might just need the IDE to be closed and reopened.

Restart the IDE?

AWOL:
Restart the IDE?

Tried that before I posted, it did nothing, but laurence got me thinking on the right track with his question about how it was installed.

I started reading through the manual install instructions and went to the libraries folders. Apparently in the folder for the time library were three folders (as in three separate libraries in the folder). So my Time library was nested in another Time folder, and arduino was having none of that ****. So I removed them from the initial folder, and it’s working fine now.

Thanks for the help, everyone! Wasn’t expecting to have this resolved so quick :smiley:

i was able to replicate your problem, the problem is: in the zip file (downloaded from this page http://playground.arduino.cc/Code/Time) are 3 library folders:

  • Time
  • TimeAlarms
  • DS1307RTC

when using the auto installer the directory structure is wrong.

See my attachments to find out how it should be.

don’t forget to restart the IDE after fixing the directories!