Hello,
I'm writting my own library In library folder I have files :
src/xxx.h
src/xxx.cpp
src/yyy.h
src/yyy.cpp
( yyy.h has some extra implementation of abstract classes declared in xxx.h )
in yyy.cpp I'm including some third part libraries, which are not installed at my computer;
At my project (arduino.ino) I'm including xxx.h, I'm not including yyy.h and yyy.h is not included anywhere in xxx files, also i'm not using any class declared in yyy.h beyond that while compile my sketch I've got error about missing libraries included in yyy.h.
How can I ignore yyy.h unless its directly included in my sketch ?
Does creating another libraries only with yyy files it the only solution ?
johnwasser:
Could you please show the entirety of your error messages? When an error occurs it usually says where each include file was included from.
ofcourse the error says the include was in file yyy.h, and thats correct becasue i'm doing include there. but yyy.h is not used anywhere at my sketch, its not included anywhere so compilator should not analyze it at all, my question is how to ignore this yyy.h to be not analyze by compilator if its not included at sketch
I believe that all of the .cpp files in the library are compiled. The build system has no way of knowing that when you include library xxx.h that you don't want all of it.
I think the solution is to split the two .cpp files (and their matching .h files) into two separate libraries so you can include one without including the other.