Direct serialization of class objects in C++ is highly complex and best avoided. Use alternative serialization. Save the data from the Settings class to a .ini, .properties or .xml, anything.