Skip to main content
deleted 11 characters in body
Source Link
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 thatAs Thread is defined in mcp_canmthread.h the tcan.h file should be.:

#ifndef tcan_h
#define tcan_h

#include <mcp_can<mthread.h>

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

Cheers!

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!

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!

Source Link
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!