C/C++中跨文件调用变量怎么定义?
我在RTC.c里面定义了extern int year,month,day,weekday,hour,min,sec;
又在Main.c里定义了extern int year,month,day,weekday,hour,min,sec;(Main()函数里面、外面都试了)
ADS编译报错:Undefined symbol year(refferred form RTC.o).其它变量报错一样。
应该在RTC.c 、Main.c里怎么声明这些变量才能在Main.c里面正常调用呢。