class C2;
C2* c2 = dynamic_cast<C2*>(A);
The first line tells the compiler "There is a class type "C2" and it will be fully defined later in the compilation unit, when you find the definition".
If you try to use C2 instances as anything more than reference or pointer declarations (until the definition of the class is required), you will get an error telling you the pointer is not to a type that is fully defined ("or "complete type" in compilese language).
To fix:
#include <C2.h> // header where "class C2 { ... };" is defined
// no longer necessary: class C2;
C2* c2 = dynamic_cast<C2*>(A); // this should now compile