Sometimes, my IDE sees timer.h in my library folder. That's on a good day. But other days, it does not see it and I get the error message, "Invalid library found in C...no headers files (.h)" Yet in all cases, timer.h is there in the library folder. Replacing my timer.h with a fresh copy doesn't always help (but sometimes does). Rebooting doesn't always help (but sometimes does). What is happening? My IDE is ver 1.8.9.
do you have more than one library folder on your hard drive? that makes things twitchy.
You make a good point. But I checked, no, I have no duplicate library folders. Thanks for the good suggestion. But I've learned something interesting: The sketch compiles nicely, despite the error message I cited earlier, which appears when uploading to my Nano. It seems that I can ignore the error message. Very odd.
When it tells you where it found the invalid library, does it say anything more than "C...."? Knowing what library it doesn't like might help.
Here you go. This is the message I receive when uploading to the Arduino. It displays twice (and sometimes three times) each time I upload.
Invalid library found in c:\Users\Richard\Documents\Arduino\libraries\Timer.h: no headers files (.h) found in C:\Users\Richard\Documents\Arduino\libraries\Timer.h
Of course, Timer.h is there, inside the libraries folder.
Thanks,
Richard
c:\Users\Richard\Documents\Arduino\libraries\Timer.h
That is a very strange folder name
Folder should be named timer, not timer.h, and it should contain a file named timer.h
Obviously, I still do not understand libraries. So, my patient friends, it appears each library needs to be inside a unique folder, which is itself under the larger "libraries" folder? Zat so?
Correct.
The folder structure for a library named Timer should look like this:
{sketchbook folder}
|_libraries
|_Timer
|_Timer.h
|_etc.
You can find the location of the sketchbook folder in the Arduino IDE at File > Preferences > Sketchbook location. In your case, it seems to be at c:\Users\Richard\Documents\Arduino. The Arduino IDE will not recognize a file that you just dump directly in the libraries folder.
Well sonofagun. Now I know. Thanks to everyone for the help!
I thought I had this problem fixed. But it has popped up again. I get the error message:
Timer.h: No such file or directory
However, I have my files set up like this:
sketchbook folder
libraries
timer
timer.h
Why won't the IDE see timer.h? It used to ...
Thanks. Again.
Even on non-case sensitive operating systems like Windows, #include directives in the Arduino IDE are case sensitive. If your #include directive is for Timer.h but the file is timer.h then you will get this error.
Timer.h: No such file or directory
Capital T
sketchbook folder
libraries
timer
timer.h
Lowercase t
My error. I typed my post poorly. I did not know it was all case sensitive here. The IDE is asking to include Timer.h. Timer.h (upper case) is inside the folder Timer (upper case). So everything is upper case in my folders, and the IDE include directive is for Timer.h, also in upper case. But the IDE cannot find it...
Is the problem still occurring intermittently?
RichP:
But the IDE cannot find it...
Remember that the IDE doesn't re-scan your libraries folder on every compile. You can force a re-scan by entering Tools->Manage Libraries... or by re-starting the IDE. If you don't do that, the IDE won't know about any changes you made in the libraries folder.
Ever since Arduino IDE 1.6.6, it does rescan the libraries on every compilation.