user11150: I'm using mthreads (https://github.com/jlamothe/mthread) for my arduino. But now as the project is getting bigger, it would make sense to break it up in several files.
I successfully outsourced already a part which is not threaded. But somehow I cannot make up my mind how to use mthread in conjunction with several header files. 
here is what I got: 
main: call header:
#include "tcan.h"

tcan.h:
#ifndef tcan_h
#define tcan_h

#include "Arduino.h"

class tcan : public Thread {
  public: tcan();
  protected: bool loop();
  private:
};
#endif

tcan.cpp
#include "Arduino.h"
#include "tcan.h"
#include <mcp_can.h>

bool tcan::loop() {
  // lala
  return true;
}

but I get an error when compiling:

tcan.h:6:28: error: expected class-name before '{' token  class tcan :
  public Thread {

Thanks in advance

user13432: The compiler error is due to that the compiler does not know what Thread is.

tcan.h:6:28: error: expected class-name before '{' token class tcan : public Thread {

The issue is that the header file is not complete. A good practice is to include all header files that are needed to read the header file. As Thread is defined in mthread.h the tcan.h file should be: 
#ifndef tcan_h
#define tcan_h

#include <mthread.h>

class tcan : public Thread {
public: tcan();
protected: bool loop();
private:
};
#endif

Cheers!

11150: <p>I'm using mthreads (<a href="https://github.com/jlamothe/mthread" rel="nofollow">https://github.com/jlamothe/mthread</a>) for my arduino. But now as the project is getting bigger, it would make sense to break it up in several files.</p>

<p>I successfully outsourced already a part which is not threaded. But somehow I cannot make up my mind how to use mthread in conjunction with several header files. </p>

<p>here is what I got: </p>

<p>main: call header:</p>

<pre><code>#include "tcan.h"
</code></pre>

<p>tcan.h:</p>

<pre><code>#ifndef tcan_h
#define tcan_h

#include "Arduino.h"

class tcan : public Thread {
  public: tcan();
  protected: bool loop();
  private:
};
#endif
</code></pre>

<p>tcan.cpp</p>

<pre><code>#include "Arduino.h"
#include "tcan.h"
#include &lt;mcp_can.h&gt;

bool tcan::loop() {
  // lala
  return true;
}
</code></pre>

<p>but I get an error when compiling:</p>

<blockquote>
  <p>tcan.h:6:28: error: expected class-name before '{' token  class tcan :
  public Thread {</p>
</blockquote>

<p>Thanks in advance</p>
 13432: <p>The compiler error is due to that the compiler does not know what Thread is.</p>

<blockquote>
  <p>tcan.h:6:28: error: expected class-name before '{' token class tcan : public Thread {</p>
</blockquote>

<p>The issue is that the header file is not complete. <strong>A good practice is to include all header files that are needed to read the header file.</strong> As <em>Thread</em> is defined in <em>mthread.h</em> the <em>tcan.h</em> file should be: </p>

<pre><code>#ifndef tcan_h
#define tcan_h

#include &lt;mthread.h&gt;

class tcan : public Thread {
public: tcan();
protected: bool loop();
private:
};
#endif
</code></pre>

<p>Cheers!</p>
