Can't include library from header file

Hey all, I’m new here. Have been having a lot of fun with my trusty arduino 328, but i’ve run into a problem. I can import libraries as expected from regular source files, but not from .h’s. If i try to import any library from a .h, it fails to find the relevant header. Smallest example that breaks:

Main sketch:

#include "Cls1.h"
void setup(){
  Cls1 bill();
}
void loop(){}

Cls1.h:

//FAILS HERE with error: EEPROM.h: No such file or directory
#include <EEPROM.h> //can be any library, just an example. 
class Cls1
{
private:
public:
  Cls1();
};

Cls1.pde:

#include "Cls1.h"
Cls1::Cls1() {
}

Any ideas? I admit I’m not very good at C++, I may be overlooking something stupid.

EDIT: Arduino 0015 on WinXP.

Try:
Cls1.h

#ifndef CLS1_H
#define CLS1_H
#include <EEPROM.h> //can be any library, just an example.
class Cls1
{
private:
public:
  Cls1();
};
#endif

Thanks for your help. Unfortunately, the behavior is the same...

Main sketch:

#include <EEPROM.h> //include the library Cls1 uses here.
#include "Cls1.h"
void setup(){
  Cls1 bill();
}
void loop(){}

Yeah, that's what I'm doing at the moment, it's a workaround. I just don't like the order of my #includes to matter. That said, I'll just go with this way for now. I'll update if I find out something. Thanks!

Maybe this would work in the header:

#include "../EEPROM/EEPROM.h"

Hi, as you might know an arduino-sketch (pde-file) has to be preprocessed by the IDE to turn it into plain C-code that is handed over to the compiler. This involves searching for all library-include statements in the main pde-file, and adding a compiler-directive to have them included in the resulting upload-code.

But the arduino-preprocessor does not do this for your extra *.h or .*cpp in your sketch. So what you are trying is not possible (with the current arduino-IDE version).

Eberhard

I’ve walked into this problem too when I needed to use the SPI library from an header file, but I made a workaround.
This should work:

#include <../../../../libraries/EEPROM/EEPROM.h>