如何修复 Keil 错误 C129: "missing ';'" 但没有任何缺失的分号 (EFM8)
问题:
你有类似这样的源代码
example.c
uint16_t convert(uint16_t input) {
return input * 2;
}你想使用 EFM8 编译
example.c
// *** ERROR C129 IN LINE 1 OF C:\Users\user\TestProject\src\Test.c: missing ';' before 'convert'
解决方案
Keil 不知道 convert() 声明前的 uint16_t 是什么。
example.c
#include <stdint.h>stdint.h 包含几种标准整数类型的声明,如 uint8_t、uint16_t、uint32_t、int16_t 等。
最终代码应该看起来像这样:
example.c
#include <stdint.h>
uint16_t convert(uint16_t input) {
return input * 2;
}Check out similar posts by category:
EFM8
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow