I don't know what is wrong with this code. I have the following, very simple, class:
class SetOfCuts{ public: static LeptonCuts Leptons; static ElectronCuts TightElectrons; static ElectronCuts LooseElectrons; //*** //more code }; and, for example, the type ElectronCuts is defined before in the same .h file as:
struct ElectronCuts{ bool Examine; //**** //other irrelevant stuff }; Nothing too complicated, I think.
My understanding is that, in the main program, I can do:
SetOfCuts::LooseElectrons.Examine = true; but if I do this, I get:
undefined reference to `SetOfCuts::LooseElectrons' If, instead, I do:
bool SetOfCuts::LooseElectrons.Examine = true; I get:
error: expected initializer before '.' token I don't know why I cannot access the members of the structs. I am missing something obvious about static data members but I don't know what it is.
Thanks a lot.