This is probably a noob question, but...

When I create a static class member of an object type, for example:
Qt Code:
  1. class A {
  2. static const A fixed = A();
  3. // should really be immutable, but const not necessary
  4. };
To copy to clipboard, switch view to plain text mode 

It produces an error "invalid in-class initialization of static data member of non-integral type" so i leave it as:
Qt Code:
  1. class A {
  2. static A mFoo;
  3. // should really be immutable, but const not necessary
  4. };
To copy to clipboard, switch view to plain text mode 
hoping that A will be defined, but apparently it's not. If I leave it like this and try to define it in a function it complains "undefined reference to `A::mFoo'". Examples on the subject use integral data types so it works. I want it to be a fixed object. So how am I supposed to define it?? If I use a pointer and allocate memory the situation doesn't change.