TMap::GetValue gives Fatal in <TClass::TClass>

From: Pasha Murat (murat@cdfsga.fnal.gov)
Date: Wed Nov 19 1997 - 23:06:20 MET


	Hello,

it looks very much like you didn't define a variable of TROOT type somewhere 
in your code before calling any of ROOT functions (or ROOT object constructors). 
This usually helps.
				Regards, Pasha.
--------------------------------------------------------------------------------
Martin Woudstra writes:
 > Dear Rooters,
 > 
 > I am using Tmap in my code to store a map of readings of alignment systems
 > with their names. But when I do a TMap::GetValue I get the following error 
 > message during runtime:
 > 
 > Fatal in <TClass::TClass>: ROOT system not initialized
 > 
 > I'm using aCC in HPUX 10.20. Before I used g++, and it worked fine.
 > Can somebody please tell me where the problem could be?
 > 
 > Regards,
 > Martin.
 > 
 > Relevant code:
 > 
 >     char szSysId[ALISYSIDLEN + 1];
 >     TMap mOffsets;	// map of offsets with SysId as key
 >     CReading *Readings;
 >     CReading *pReadingsFound;
 > 
 > 	for (iSys = 0; iSys < nSysOfType; iSys++)
 > 	{
 > 	    Readings = new CReading;
 > 	    OffFile >> szSysId >> *Readings >> newl;
 > 	    mOffsets.Add(new TObjString(szSysId), Readings);
 >         }
 > 	for (iSys=pType->iFirstSysNo; iSys < pType->iFirstSysNo+pType->nSys; iSys++)
 > 	{
 > 	    cerr << "Trying  mOffsets.GetValue of " << aAliSys[iSys].GetName() << endl;
 >             if ((pReadingsFound = (CReading *)mOffsets.GetValue(new
 > TObjString(aAliSys[iSys].GetName()))) == 0)
 >             { 
 >                error stuff
 >             }
 > 	    else
 > 	    {
 > 	       cerr << "Assigning *pReadingsFound" << endl;
 > 	       aAliSys[iSys].Zero = *pReadingsFound;
 > 	    }
 >         }
 > 
 > CReading inherits from TObject, and aAliSys[] from TNamed.
 > 
 > Output produced:
 > 
 > Trying  mOffsets.GetValue of 0A
 > Fatal in <TClass::TClass>: ROOT system not initialized
 > aborting
 > zsh: 3870 abort      geofix



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET