|
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统 驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe |
急:error:C2285E |
作者:eaivip 栏目:ARM技术 |
在一个头文件中定义了一个结构体,如下 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 于 2007/3/2 19:29:00 发布:
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; |
|
|
免费注册为维库电子开发网会员,参与电子工程师社区讨论,点此进入 |
Copyright © 1998-2006 www.dzsc.com 浙ICP证030469号 |