C++ 简单版本:error:';x';不命名类型

C++ 简单版本:error:';x';不命名类型,c++,arduino,C++,Arduino,我为Arduino上了这门课: #include <ADXL362.h> #include <SPI.h> #ifndef holyGraal_H #define holyGraal_H class holyGraal { private: ADXL362 adxl; public: holyGraal(); }; #endif “main”程序有setup和loop,但都是空的。当我试图编译它时,我得到了错误: In file included from

我为Arduino上了这门课:

#include <ADXL362.h>
#include <SPI.h>

#ifndef holyGraal_H
#define holyGraal_H

class holyGraal {
private:
  ADXL362 adxl;
public:
  holyGraal();
};

#endif
“main”程序有setup和loop,但都是空的。当我试图编译它时,我得到了错误:

In file included from holyGraal.cpp:1:
holyGraal.h:9: error: 'ADXL362' does not name a type

我不明白。为什么include没有为我的类定义ADXL362?我确实读过“如何为Arduino制作图书馆教程”,这是经常提到的。我不想创建一个库,只想创建一个用于我的项目的类。

您确定它包含您认为包含的ADXL362.h吗?您可能想阅读
头文件以查看它真正包含的内容?我确定ADXL362.h定义了ADXL362。如果启动一个新的草图并将其包含在内,则实例化ADXL362对象不会有任何问题。您确定编译器已成功包含
ADXL362.h
?您确定在include路径的其他地方没有意外地有另一个名为相同内容的文件吗?(注意:如果您在Windows上,文件名不区分大小写,因此
adxl362.h
adxl362.h
在编译器看来是一样的。)我如何确定这一点?
In file included from holyGraal.cpp:1:
holyGraal.h:9: error: 'ADXL362' does not name a type