我在ram.c中定义了需要的全局变量
#define uchar unsigned char
uchar counter3;
uchar scounter;
uchar mcounter;
uchar scounter1;
uchar code Ht1621Tab[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
uchar code TAB[]=
{
0x0b,0x0e, //0
0x00,0x06, //1
0x07,0x0c, //2
0x05,0x0e, //3
0x0c,0x06, //4
0x0d,0x0a, //5
0x0f,0x0a, //6
0x00,0x0e, //7
0x0f,0x0e, //8
0x0d,0x0e, //9
0x00,0x00,
0x0b,0x0e, //0
0x00,0x06, //1
0x07,0x0c, //2
0x05,0x0e, //3
0x0c,0x06, //4
0x0d,0x0a, //5
0x0f,0x0a, //6
0x00,0x0e, //7
0x0f,0x0e, //8
0x0d,0x0e, //9
0x0e,0x0e, //A
0x0f,0x02, //b
0x07,0x00, //c
0x07,0x06, //d
0x0f,0x08, //E
0x0e,0x08, //F
0x07,0x08, //C
0x0b,0x00, //L
};
但文件组中除了main.c外,还有其他文件需要这些变量或TAB,可在其他文件中加#include "ram.c"时,就会出现MULTIPLE PUBLIC DEFINITIONS,这些变量到底该怎么定义才能让多个文件都能用?
|