C语言编译报错:expected ‘=‘, ‘,‘, ‘;‘, ‘asm‘ or ‘__attribute__‘ before ‘net_state‘

C语言编译错误:预期的符号缺失
文章讲述了在C语言编程中遇到的编译错误,提示预期的=、,、;、asm或__attribute__符号在net_state前缺失。这可能是由于函数声明后的分号遗漏,也可能是某个头文件中的符号问题。建议检查相关头文件和分号使用。

C语言编译报错:expected '=', ',', ';', 'asm' or '__attribute__' before 'net_state'

报错原因:

翻译:语法错误,缺少了一些必要的符号。

注意检查:

声明函数的时候()后面有没加分号“;”

NOTE:大概率是某一个头文件中缺少符号。不要被报错信息中的‘net_state’误导,有可能和这个变量没关系。
bmp.c: 在函数‘get_lcd_event’中: bmp.c:5:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ bmp.c:52:5: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ In file included from bmp.h:6:0, from bmp.c:1: lcd.h:14:5: 错误: 原型函数定义中使用了旧式参数声明 int get_lcd_event(int* x,int* y) ^ bmp.c:70:5: 错误: expected ‘{’ at end of input } ^ light.c: 在函数‘get_lcd_event’中: light.c:6:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:15:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:27:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:38:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:49:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:75:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ light.c:86:1: 错误: expected ‘{’ at end of input } ^ lcd.c: 在函数‘get_lcd_event’中: lcd.c:6:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ In file included from lcd.c:1:0: lcd.h:14:5: 错误: 原型函数定义中使用了旧式参数声明 int get_lcd_event(int* x,int* y) ^ lcd.c:68:1: 错误: expected ‘{’ at end of input } ^ main.c: 在函数‘get_lcd_event’中: main.c:9:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ In file included from main.c:3:0: lcd.h:14:5: 错误: 原型函数定义中使用了旧式参数声明 int get_lcd_event(int* x,int* y) ^ main.c:14:1: 错误: expected ‘{’ at end of input } ^ game.c: 在函数‘get_lcd_event’中: game.c:5:1: 错误: 形参‘flag’已初始化 int flag = 0; // 全局变量,当前玩家标志(0或1) ^ game.c:6:1: 错误: 形参‘Game_buf’已初始化 unsigned int Game_buf[12][20] = {0}; //12x20的游戏棋盘 ^ game.c:9:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ game.c:21:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ game.c:34:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ game.c:48:1: 错误: expected=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘{’ token { ^ In file included from game.c:1:0: lcd.h:14:5: 错误: 原型函数定义中使用了旧式参数声明 int get_lcd_event(int* x,int* y) ^ game.c:85:1: 错误: expected ‘{’ at end of input } ^
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值