语法错误 - 令牌";" 在"变量名称"之前插入

Ang*_*elo 2 c header extern

我在用C编程.我收到以下错误:

ctc E208: ["..\..\ECB\Include\ecb.h" 4/11] syntax error - token ";"
inserted before "u8_vTeethBeforeMissingTeeth1"
Run Code Online (Sandbox Code Playgroud)

这是我在.h文件中的内容:

#ifndef __ECB_H__
#define __ECB_H__

extern u8 u8_vTeethBeforeMissingTeeth1;
extern u8 u8_vTeethBeforeMissingTeeth2;

#endif /* __ECB_H__ */
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我这部分代码中缺少什么?

Jon*_*ler 6

麻烦的是你的标题不是自包含的.它依赖于u8此处未定义的类型' '(并且未在此之前包含的任何其他标头中定义).u8在声明"缺牙"变量之前,您应该包含在'ecb.h' 标题中定义' '的标题.

标题应该是独立的; 如果您需要标题的服务,您应该能够包含它而不必担心还需要包含哪些内容.标准的C标题为您做到了 - 您应该使用自己的标题为自己做.