Skip to main content
1 of 2
Mikael Patel
  • 8k
  • 2
  • 16
  • 21

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. Assuming that Thread is defined in mcp_can.h the tcan.h file should be.

#ifndef tcan_h
#define tcan_h

#include <mcp_can.h>

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

Cheers!

Mikael Patel
  • 8k
  • 2
  • 16
  • 21