I need to see your code to completely understand where the error might be, but you could try this:
In the header:
extern A* aClass;
In the main.cc, before the main function:
A* aClass;
and inside the main function:
int main()
{
...
aClass = new A();
...
}
Hopefully that helps!