Using a Library inside of a Library

Is there a trick to using one library inside of another library? I looked and I didn’t see this done by other libraries except with Matrix using Sprite. I didn’t see anything special except using “” instead of <>.

In my cpp file I have problems finding the .h file of the lower level library and also if I force it, I appear to have mixing (cpp/c) problems.

I was trying to use Wire.


The “” vs. <> tells the compiler where to look for the header files. The <> says to look in the compiler-specific directories only. The “” says to look there, and relative to the sketch directory.

The compiler only compiles the cpp files for the header files included in the sketch. So, if you want to use library B inside library A, the header files for library A AND library B need to be included in the sketch.

If only library A’s header file is included, all references to library B will fail, even though the libraryA’s header or source file includes linraryB.h.

Thanks PaulS adding an include to Wire.h in my sketch worked like a charm. :)