I can do this
extern int i;
extern int i;
But I can\'t do the same with a class
class A {
..
}
class A {
..
}
The first (extern) makes a reference to an existing variable. So you are just indicating the variable twice.
The class declaration gives meaning to a type (your class: A). You are trying to give two meanings to A. This is not of any use for you, and can only confuse, so the compiler protects you from it.
Btw, if you put both classes in difference namespaces you can give them the same name.