Possible Duplicate:
What is the difference between a definition and a declaration?
In my A.h file:
extern int a,b;
private: int x,y;
public: A():x(1),y(2){}
void total();
In my B.h file:
private: int a,b;
public: A():a(1),b(2){}
In my C.cpp file:
#include "A.h"
void total(){
int total = a + b + x + y;}
When I build the program, It said that :
undefined reference to `a';
undefined reference to `b';
Can anybody tell me why ? Thank you.