打印
[ZLG-ARM]

急:error:C2285E

[复制链接]
2851|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
eaivip|  楼主 | 2007-3-2 16:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
TI, ui, API, pi, se
在一个头文件中定义了一个结构体,如下

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   : (Serious) C2934E: duplicate definition of 'clockConfig'
config.h line 121   

D:\soft\ads\work\ads\BX-A\3-2\3-2-5\src\ram.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\iap.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\guiapi.c: 0 warnings, 8 errors, 3 serious errors

相关帖子

沙发
yingq5594| | 2007-3-2 19:29 | 只看该作者

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;

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

15

帖子

0

粉丝