Go Down

Topic: Can't include library from header file (Read 3 times) previous topic - next topic


Maybe this would work in the header:

Code: [Select]
#include "../EEPROM/EEPROM.h"


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).



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:
Code: [Select]
#include <../../../../libraries/EEPROM/EEPROM.h>

Go Up