user10657: 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.

user313: Nested includes lead to these convoluted error messages and are in general, a PITA for the next reader to follow & 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. 

10657: <p>I am trying to create a new library that uses another existing library.</p>

<p>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.</p>

<p>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:</p>

<blockquote>
  <p>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;</p>
</blockquote>

<p>Even if the library only contains the include of the first one.</p>
 313: <p>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: </p>

<pre><code>#error DepLibe.h: Missing required include file ReqLibe.h
</code></pre>

<p>Most .h files guard against multiple-inclusion by</p>

<pre><code>#ifndef _REQLIBE_H_
#define _REQLIBE_H_
// library definitions here
</code></pre>

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