This issue was discussed in the forum but the response is a bit too technical for me to digest. I would appreciate specific inputs for my issue here. The warning message is:
the warning means that rootcling is not actually generating a dictionary for class ana_syns: it sees that the linkdef file has a rule for it, but it doesn’t see that class in the headers passed to it. In fact, are you passing a header with the declaration of the class to rootcling?
The issue is bit more complicated than I thought. Here is the LinkDef.h:
#ifdef __CLING__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class ana_eff_tree+;
#pragma link C++ class ana_syns+;
#endif
When rootcling run on ana_syns, it generates the dictionary file for ana_syns but complains “Unused class rule” on ans_eff_tree. When rootcling run on ana_eff_tree, it also generates dictionary file for ana_eff_tree but complains “Unused class rule” on ana_syns. If I create a separate LinkDef file for each files, then there’s no warning messages. Does that mean we can’t group all different classes into a single LinkDef files?
OK. It’s due to the set up in my cmake file which produce a separate dictionary files for each class. After goup them together to produce a single dictionary file, there’s no warning messages anymore. Somethings like the following:
set(head_file_list)
foreach(main_file ${MAIN_FILES})
get_filename_component(barename ${main_file} NAME_WE) # get the name without the extension
LIST(APPEND head_file_list src/${barename}.h)
endforeach()
ROOT_GENERATE_DICTIONARY(dict ${head_file_list} LINKDEF LinkDef.h)