Really stupid question about including a header from a lib

Hi All...

I wrote a small library by subclassing the Bounce library. So I need to include the Bounce.h file in my header file, which I did. When I moved my library into its own folder below /library, the compiler could no longer find Bounce.h.

I tried:

#include <Bounce.h>
#include <../Bounce.h>
#include "../Bounce.h"

My header file looks like:

#ifndef PULSER_H
#define PULSER_H

#include <WProgram.h>
#include <Bounce.h>

.
.
.

#endif

Try putting:

#include <Bounce.h>

in your main sketch as well as in your own library.

The Arduino IDE only knows to include a library (and thus tell the compiler to include the path into where it searches) when it finds it in a sketch file. The IDE searches for this using regular expressions, looking for anything like "#include <blah.h>"

Well including Bounce.h in the main sketch should not be necessary, although that's what I did to work around the problem. As to the IDE, I would think that C++ compilers preprocessor could follow the path and read the header files. There is really no way to do this?

I think we went through this before with SPI.h.

The problem is that the idea "intelligently" tries to work out which files it needs to include. And indeed it makes a copy of your files into a temporary area (hence why you don't even need to save your sketch to compile it). Nested .h files don't seem to cut it. I've complained about this before, no response as I recall.

My suggested work-around works, that's good. It shouldn't be necessary, so maybe complain louder to the developers of the IDE.

Okay thanks everyone. I have some other peevs about the IDE and I think I am quickly outgrowing it. I may invest some time in alternatives.