登录 免费注册 首页 | 行业黑名单 | 帮助
维库电子市场网
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统
驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe

急:error:C2285E

作者:eaivip 栏目:ARM技术
急:error:C2285E
在一个头文件中定义了一个结构体,如下

typedef struct{
    uint8 second;
    uint8 minute;
    uint8 hour;
    uint8 date;
    uint8 month;
    uint8 week;
    uint8 year;
} timeType

然后在另一文件中定义了一个函数:
void timeToAngle(timeType time);


编译却报错:

Error   : C2285E: expected ')' or ',' - inserted ')' before 'time'
guiapi.h LINE 57   

Error   : C2470E: function prototype formal 'timeType' needs type or class - 'int' assumed
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clockConfig'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before '*'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clock'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before ')'
guiapi.h LINE 57   

Error   : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
guiapi.h LINE 57   

Error   : (Serious) C2933E: type disagreement for 'clockConfig'
config.h LINE 121   

Error   : (Serious) C2934E: duplicate definition of 'clockConfig'
config.h LINE 121   

D:\soft\ads\work\ads\BX-A\3-2\3-2-5\src\target.c: 0 warnings, 8 errors, 3 serious errors

Error   : C2285E: expected ')' or ',' - inserted ')' before 'time'
guiapi.h LINE 57   

Error   : C2470E: function prototype formal 'timeType' needs type or class - 'int' assumed
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clockConfig'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before '*'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clock'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before ')'
guiapi.h LINE 57   

Error   : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
guiapi.h LINE 57   

Error   : (Serious) C2933E: type disagreement for 'clockConfig'
config.h LINE 121   

Error   : (Serious) C2934E: duplicate definition of 'clockConfig'
config.h LINE 121   

D:\soft\ads\work\ads\BX-A\3-2\3-2-5\src\main.c: 0 warnings, 8 errors, 3 serious errors

Error   : C2285E: expected ')' or ',' - inserted ')' before 'time'
guiapi.h LINE 57   

Error   : C2470E: function prototype formal 'timeType' needs type or class - 'int' assumed
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clockConfig'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before '*'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clock'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before ')'
guiapi.h LINE 57   

Error   : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
guiapi.h LINE 57   

Error   : C2285E: expected ')' or ',' - inserted ')' before 'time'
guiapi.h LINE 57   

Error   : C2470E: function prototype formal 'timeType' needs type or class - 'int' assumed
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clockConfig'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before '*'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clock'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before ')'
guiapi.h LINE 57   

Error   : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
guiapi.h LINE 57   

Error   : (Serious) C2933E: type disagreement for 'clockConfig'
config.h LINE 121   

Error   : (Serious) C2934E: duplicate definition of 'clockConfig'
config.h LINE 121   

Warning : C2892E: signed constant overflow: '<<'
api.c LINE 38   

Warning : C2892E: signed constant overflow: '<<'
api.c LINE 65   

D:\soft\ads\work\ads\BX-A\3-2\3-2-5\src\api.c: 2 warnings, 8 errors, 3 serious errors

Error   : C2285E: expected ')' or ',' - inserted ')' before 'time'
guiapi.h LINE 57   

Error   : C2470E: function prototype formal 'timeType' needs type or class - 'int' assumed
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'time'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clockConfig'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before '*'
guiapi.h LINE 57   

Error   : C2225W: declaration lacks type/storage-class (assuming 'int'): 'clock'
guiapi.h LINE 57   

Error   : C2285E: expected ';' or ',' - inserted ';' before ')'
guiapi.h LINE 57   

Error   : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
guiapi.h LINE 57   

Error   : (Serious) C2933E: type disagreement for 'clockConfig'
config.h LINE 121   

Error   
2楼: >>参与讨论
yingq5594
re
首先,你忘记将包含该结构体的头文件xx.h加入到你定义函数:
void timeToAngle(timeType time);的文件中,即在该文件中加入#include "xx.h";
第二,从你给的上面这个结构体来看,你忘记了在结构体后面加分号,即
typedef struct{
    uint8 second;
    uint8 minute;
    uint8 hour;
    uint8 date;
    uint8 month;
    uint8 week;
    uint8 year;
} timeType;

参与讨论
昵称:
讨论内容:
 
 
相关帖子
请教关于ucos-ii 在lpc2104上移植时出现数据中止的问题
《深入浅出ARM7-LPC213X/LPC214X》翻译存在问题
请教周公向量问题。
求教:h_jtag检测不到目标板,ISP可以连接并下载
LPC213XDEF.H(IAP全攻略版)
免费注册为维库电子开发网会员,参与电子工程师社区讨论,点此进入


Copyright © 1998-2006 www.dzsc.com 浙ICP证030469号