ROOTers,
I want to document the following error I was able to figure out and I decided to do it through this posting. The error is caused by the use of typedef while defining structures.
I was trying to compile my c++ program using rootcint. However something didn’t work out in the generation of the dictionary. My class looked like this:
class vme_V1785 : public vme_SlaveModule
{
public:
typedef struct MDS{
unsigned int IRQline;
unsigned int IRQID;
};
typedef struct eventToken{
unsigned int ADCvalue[V1785_TOTAL_MAX_CHAN];
int ctrNotValid;
int geoAddress;
int crate;
int counterActiveADCs;
bool channelActive[V1785_TOTAL_MAX_CHAN];
bool underThreshold[V1785_TOTAL_MAX_CHAN];
bool overFlow[V1785_TOTAL_MAX_CHAN];
unsigned long eventCounter;
bool boolIsEmptyEvent;
bool boolIsGoodIntegrity; //if event is formed of a header-trailer set
};
///etc… OTHER MEMEBER VARIABLE/FUNCTION DEFINITIONS
);// END OF HEADER FILE
After trying to compile, I got the error attached at the end of this posting. I was able to solve the problem by removing the typedef declaration at the beginning of structure definitions. it was a very straight forward solution. What is peculiar about his case is that the struct eventToken was implemented way early in the class and the following declaration did not cause any error (rootcint did not care):
typedef struct eventToken{ …}
However as soon as I add the new structure definition:
typedef struct MDS{ …}
I start having the errors. It was not clear to me at first why rootcint was complaining since I had already a struct type defined in my class. It took me about 6 hours, after looking at so many postings to figure out that the problem was the reserve word “typedef” in my structure definitions.
I hope this help somebody in the feature.
Cheers,
Kris
ERROR OUTPUT
rootcint -f /export/home/workspace/vmeFiles/VME_OOP24f/src/APIanalyzerDict.cxx -c -p -I/export/home/workspace/vmeFiles/VME_OOP24f/include /export/home/workspace/vmeFiles/VME_OOP24f/include/APIanalyzer.h /export/home/workspace/vmeFiles/VME_OOP24f/include/vme_FileLoader.h /export/home/workspace/vmeFiles/VME_OOP24f/include/APIanalyzerLinkDef.h
Error: Symbol MDSModuleDefaultSettings is not defined in current scope /export/home/workspace/vmeFiles/VME_OOP24f/include/vme_V1290N.h:534:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing /export/home/workspace/vmeFiles/VME_OOP24f/src/APIanalyzerDict.cxx /export/home/workspace/vmeFiles/VME_OOP24f/src/APIanalyzerDict.h !!!
Error: rootcint: error loading headers…
make[1]: *** [APIanalyzer] Error 1
make: *** [aa] Error 2