语法错误 - 标记“;”在“变量名”之前插入

发布于 2024-09-28 05:29:50 字数 383 浏览 1 评论 0原文

我正在用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┾廆蒐ゝ 2024-10-05 05:29:50

问题是你的标题不是独立的。它依赖于类型“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.

爱要勇敢去追 2024-10-05 05:29:50

这是我的猜测。你有 #define u8 并且该定义是错误的。它包含额外的;某处。

This is my guess. You have #define u8 and that definition is wrong. It contains extra ; somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文