You have to use extern , like this:
extern unsigned char rdat[12]
There's the way to declare all the related vars just once:
"MySDLib.h"-------------------------
// here follows block of SD-related variables declarations:
#ifndef _SD_Card_Lib_
#define _SD_DefArea_
extern#endif
_SD_DefArea_ int iVar1; // all SD-related variables are declared just once, all in one place - this will ease the control over the code and variables
_SD_DefArea_ char cVar2; // ...
_SD_DefArea_ unsigned char rdat[12]; //
...
#undef _SD_DefArea_
...
"SDLib.c"-------------------------
#define _SD_Card_Lib_ // this will turn
extern OFF
#include <MySDLib.h> // all SD-vars will be declared as usual
// SDLib functions follows...
...
"main.c"-------------------------
// #define _SD_Card_Lib_ // omitting this
#define will turn
extern ON
#include <MySDLib.h> // all SD-vars will be declared as
external
...