i have got 2 cpp files & a header file, which i have included in all 2 cpp files. its like this
abc.h
extern uint32_t key;
a.cpp
#include "abc.h"
uint32_t key;
int main
{
.............
}
b.cpp
#include "abc.h"
int main
{
printf("Key: %.8x\n", key);
.............
}
now when i compile a.cpp, there is no error. but when i compile b.cpp it gives error
"undefined reference to `key'". please help me in finding the problem in this code. thnx