语法错误 - 标记“;”在“变量名”之前插入
我正在用 C 编程。我收到以下错误:
ctc E208: ["..\..\ECB\Include\ecb.h" 4/11] syntax error - token ";"
inserted before "u8_vTeethBeforeMissingTeeth1"
这是我在 .h 文件中的内容:
#ifndef __ECB_H__
#define __ECB_H__
extern u8 u8_vTeethBeforeMissingTeeth1;
extern u8 u8_vTeethBeforeMissingTeeth2;
#endif /* __ECB_H__ */
谁能告诉我在这部分代码中缺少什么?
I'm programming in C. I'm getting the following error:
ctc E208: ["..\..\ECB\Include\ecb.h" 4/11] syntax error - token ";"
inserted before "u8_vTeethBeforeMissingTeeth1"
Here is what I have in the .h file:
#ifndef __ECB_H__
#define __ECB_H__
extern u8 u8_vTeethBeforeMissingTeeth1;
extern u8 u8_vTeethBeforeMissingTeeth2;
#endif /* __ECB_H__ */
Can anyone please tell me what am I missing in this section of code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是你的标题不是独立的。它依赖于类型“
u8
”,该类型未在此处定义(并且未在您之前包含的任何其他标头中定义)。在声明“缺失牙齿”变量之前,您应该在“ecb.h”标头中包含定义“u8
”的标头。标头应该是独立的;如果您需要标头的服务,您应该能够包含它,而不必担心还需要包含什么。标准 C 标头会为您完成此操作 - 您应该使用自己的标头为您自己完成此操作。
The trouble is that your header is not self-contained. It relies on a type '
u8
' which is not defined here (and not defined in any of the other headers you've included before this). You should include the header that defines 'u8
' in your 'ecb.h' header before declaring your 'missing teeth' variables.Headers should be self-contained; if you need the services of the header, you should be able to include it without worrying about what else needs to be included. The standard C headers do that for you - you should do it for yourself with your own headers.
这是我的猜测。你有 #define u8 并且该定义是错误的。它包含额外的;某处。
This is my guess. You have #define u8 and that definition is wrong. It contains extra ; somewhere.