I’m trying to add a new variable to a class that has a custom streamer. So I incremented the ClassDef from 2 to 3 (actually a ClassDefOverride if that makes any difference), and added in the member variable to the header.
I have a little trial function that should write and then read the class to a file.
When I try and run the trial function I get the error;
Error in <TBufferFile::ReadClassBuffer>: Could not find the StreamerInfo for version 2 of the class TFCSParametrizationBinnedChain, object skipped at offset 72
Error in <TBufferFile::CheckByteCount>: object of class TFCSParametrizationBinnedChain read too few bytes: 2 instead of 1229
Error in <TBufferFile::CheckByteCount>: object of class m_input read too few bytes: 3 instead of 66
terminate called after throwing an instance of 'std::length_error'
Which I guess makes sense, since I have just changed the code to represent version 3, so version 2 can’t be found there, and I’m writing a new file, not reading an existing one, so version 2 isn’t going to be there either.
But why does it want to have version 2 anyway? It should be reading and writing version 3.
ROOT Version: 6.24/06
Platform: NAME=“CentOS Linux” VERSION=“7 (Core)” ID_LIKE=“rhel fedora” CLUSTER=“sunrise”
Compiler: using GNU Make 3.82, which presumably calls g++ (GCC) 11.2.0 under the hood.