Error generating a dictionary

I’m trying to read ROOT files from Python, but I get errors for some fields (that I don’t use), so I wanted to create a dictionary. I don’t have the complete working program on my laptop, but I have source files for the Event class (part of our collaboration code), and I tried to generate a dictionary for that class.

$rootcint -f DCEEvent_dict.cc -c DCEEvent.hh LinkDef.h 
Warning: Unused class rule: RecoCoincInfo
$root
root [0] .L DCEEvent_dict.cc+
Info in <TUnixSystem::ACLiC>: creating shared library /home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent/./DCEEvent_dict_cc.so
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:62:90: error: pasting formed ')_c', an invalid preprocessing token
      static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstance(); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                         ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:62:90: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:101:133: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::ParamStore*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                    ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:101:133: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:131:131: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::IProcess*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                  ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:131:131: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:174:131: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::InfoUnit*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                  ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:174:131: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:198:132: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::Processor*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                   ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:198:132: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:233:136: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::LoopProcessor*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                       ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:233:136: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:276:129: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::PMTHit*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:276:129: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:308:136: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::ParameterInfo*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                       ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:308:136: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:340:128: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::OVHit*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                               ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:340:128: error: pasting formed ')_c', an invalid preprocessing token
/opt/root/install/include/Rtypes.h:362:37: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
                                    ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
In file included from <<< cling interactive line includer >>>:1:
././DCEEvent_dict.cc:372:129: error: pasting formed ')_c', an invalid preprocessing token
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal(static_cast<const ::OVInfo*>(nullptr)); R__UseDummy(_R__UNIQUE_DICT_(Init));
                                                                                                                                ^
/opt/root/install/include/Rtypes.h:362:10: note: expanded from macro 'R__UseDummy'
   class _NAME2_(name,_c) { public: _NAME2_(name,_c)() { if (name) { } } }
         ^
/opt/root/install/include/ROOT/RConfig.hxx:458:38: note: expanded from macro '_NAME2_'
#   define _NAME2_(name1,name2) name1##name2
                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Error in <ACLiC>: Executing '/opt/root/install/bin/rootcling -v0 "--lib-list-prefix=/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent/DCEEvent_dict_cc_ACLiC_map" -f "/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent/DCEEvent_dict_cc_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/opt/root/install/etc/" -I"/opt/root/install/etc//cling" -I"/opt/root/install/etc//cling/plugins/include" -I"/opt/root/install/include/" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/bin" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/Cheetah" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/config" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCActionUnit" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCAna" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCAnalysisJob" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCBase" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCCalibAna" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCCalibApply" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCCT" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDB" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDbiClasses" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDBInterface" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDiagnosisUnit" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDisplay" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDMonitor" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCDQC" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCFlagUnit" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCGeo" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCGLG4sim" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCNuGen" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCNuGen2" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCOnlineDB" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCProd" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCReco" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCRecoDT" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCRecoPulse" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCRegistry" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCRoSS" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCSelectionUnit" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCTemplate" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCTreeMixer" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCTrigMon" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCUtil" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCValidity" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/doc" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DOGS-svninfo.h" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/GNUmakefile" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/lib" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/libDCcompat" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/Makefile" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/README.txt" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/ReadRed" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/ReleaseNotes" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/ROVER" -I"/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/SimApp" -I"." -I"/opt/root/install/include" -D__ACLIC__  "/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent/./DCEEvent_dict.cc" "/home/yaroslav/work/double_chooz/programs/dogs_source/Prod-10-02-p16/DCEvent/DCEEvent_dict_cc_ACLiC_linkdef.h"' failed!

___
_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

Sorry, this is probably a very large output, but I decided to put it complete.

So the problem is that rootcling generates a dict (without visible errors), but then this dict can’t be used by ROOT. I think there is an error somewhere in between, and maybe I could fix that? Is that a ROOT bug? Thanks for your ideas.

ROOT Version: 6.29/01, from heads/master@v6-29-01-1273-g360c0c7c54
Platform: Arch Linux (linuxx8664gcc)
Compiler: gcc (GCC) 12.2.1 20230201


Can you share the dictionary source file that rootcling generates?

I guess this one.
DCEEvent_dict.cc (444.9 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.