This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why are C++ constructors for static objects not called?

Hi

Our design uses a number of small C++ classes.  We declare the objects statically, rather than using new, because we don't want to use the heap.

For such objects we have found that their constructors are not called (or rather that the member initialisation specified by the constructors does not happen).

Why is this?  Is it to do with the selection of RAM-based or ROM-based initialization?

Could I work around this issue by using the C++ 'placement new' operator?

Best regards

David