比如说,在main.c定义
const int global_const=1;
在led.c:
第一种情况:
int a=global_const;
..\HARDWARE\LED\led.c(4): error: #20: identifier "global_const" is undefined
第二种情况:
int const global_const;
int a=global_const;
..\HARDWARE\LED\led.c(4): error: #28: expression must have a constant value
第三种情况:
extern int const global_const;
int a=global_const;
..\HARDWARE\LED\led.c(4): error: #28: expression must have a constant value
第四种情况:
int const global_const;
..\OBJ\LCD.axf: Error: L6200E: Symbol global_const multiply defined (by led.o and main.o).
|