We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
We have a c++ class that cannot be compiled anymore since the compiler generates a "Class too large" message.
I decided to remove objects from it and to access them as pointers, ie:
I changed from:
class controller { Class1 Obj1; Class2 Obj2; Class3 Obj3; /* and methods accessing these objects */ void method() { Obj1.myMethod(); ... } }
to
class controller { Class1* pObj1; Class2* pObj2; Class3* pObj3; /* and methods accessing these objects */ void method() { pObj1->myMethod(); ... } }
Class1 Obj1; Class2 Obj2; Class3 Obj3; are then declared in another file and I called the following function at the very beginning to initialize my pointers:
Controller:InstallObjects() { pObj1 = &Obj1; pObj2 = &Obj2; pObj3 = &Obj3; }
So everything should work as before and the "class too large" error should be removed.
What happened is:
I am sure that InstallObjects is called before anything is accessed so pObj1, pObj2 and pObj3 are initialized and cannot be NULL
I followed the execution: pObj1->* calls are ok but at some point a pObj1->a_method() is not called ! The address seems to be bad (I cannot confirm as I don't have any emulator and I'm just debugging using printfs). My compiler version is 6.18 (the latest). I suspect a compiler or linker error...
Thanks a lot for your precious help,
Pierre