Why can't I include a library in another one? I am trying to create a new library that uses another existing library.

The original library declares a way to create an object called Multiserial that can be created in the main file and the program is correctly compiled.

However, when I include this library in a second one and I try to build the program, then the IDE returns an error that says:


  In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:27:0,
                   from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
                   from MultiSerial.h:17,
                   from maqMODBUSmst.h:5,
                   from maqMODBUSmst.c:1:
  C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Printable.h:25:1: error: unknown type name 'class'
   class Print;


Even if the library only contains the include of the first one.
Nested includes lead to these convoluted error messages and are in general, a PITA for the next reader to follow &amp; understand. It is better practice for the dependent library to test, at compile time, for the existence of its required libraries and for each one found missing, issue: 

#error DepLibe.h: Missing required include file ReqLibe.h


Most .h files guard against multiple-inclusion by

#ifndef _REQLIBE_H_
#define _REQLIBE_H_
// library definitions here


or some variant of it. DepLibe.h can test for these guard symbols. DepLibe.h should document the dependencies in prominent comments.