举例 我在a.h 中定义
typedef struct struct2_TimeData
{
unsigned char yearh;
unsigned char weekday;
unsigned char yearl;
unsigned char month;
unsigned char day;
unsigned char hour;
unsigned char minute;
unsigned char second;
} struct_TimeData;
extern struct_TimeData CurrentTime;
在a.c中使用 CurrentTime.yearh 等等编译不报错。
要想在b.c使用哪个机构体,于是乎把a.h头文件包含进来,编译无错。
问题来了一mack就报错 Error[e46]: Undefined external "CurrentTime" referred in iic
编译环境: IAR Embedded 5
C语言大哥请指教,以前Keil也出现过,实在找不到方法就去掉结构体改成全局变量,今天在IAR也不行。 |