> You are using the StartupCode.lib library, which is for C
> only.  It doesn't know about C++ constructors.

Thanks for your reply... but I'm not sure that this is the problem. I have
overridden operator new and delete and have no trouble allocating non-static
objects (see the code below). Only when using a static member do I get the
link error "Link Error: StartupCode.c: Entry Point '__InitCode__' is
undefined." ie. if class A wasn't there, I could happily new a B...

class Allocatable
{
public:
virtual ~Allocatable() {}
void *operator new(unsigned long aSize) {
return MemPtrNew(aSize);
}
void operator delete(void *aPtr, unsigned long aSize) {
MemPtrFree(aPtr);
}
};

class B : public Allocatable {
};

class A : public Allocatable {
static B b;
};

B A::b;

______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to