求助STVD的结构体定义报错问题

2019-07-19 20:46发布

代码如下:

typedef struct 
{
u8 counter;
u8 longFlag;
u8 shortFlag;
u8 temp;
} KeyScanTpyedef;



KeyScanTpyedef zd;

zd.counter=1;
zd.longFlag=1;
zd.shortFlag=1;
zd.temp=1;

然后报错:


----------- Project test - STM8 Cosmic - Configuration Release -------------

Compiling ..userkey.c...
cxstm8 +mods0 -pp -i..include -i..user -i..stm8s_stdperiph_driverinc -i"C:Program FilesCOSMICCXSTM8Hstm8"  -clRelease -coRelease ..userkey.c
#error cpstm8 ..userkey.c:40(0+2) redeclared external zd
#error cpstm8 ..userkey.c:41(0+2) redeclared external zd
#error cpstm8 ..userkey.c:42(0+2) redeclared external zd
#error cpstm8 ..userkey.c:43(0+2) redeclared external zd
..userkey.c:
 The command: "cxstm8 +mods0 -pp -i..include -i..user -i..stm8s_stdperiph_driverinc -i"C:Program FilesCOSMICCXSTM8Hstm8"  -clRelease -coRelease ..userkey.c" has failed, the returned value is: 1
exit code=1.

test.elf - 6 error(s), 0 warning(s)


请问是什么原因?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。