ClassImp & ClassDef Issues


After a long search i’m posting here in hope to solve this. I’m trying to work with Atlas code offline, for that i’ve downloaded and built the Atlas base analysis - so far all is good.

I’m used to working with IDE’s so i’m trying to create a project file for my files using this for instructions:

I have only 2 files in my project, MyxAODAnalysis.cxx & MyxAODAnalysis.h, these files inherit from TObject and by doing so they have the lines:

ClassImp(MyxAODAnalysis); ClassDef(MyxAODAnalysis, 1);

when i’m compiling the files using Atlas rc compile everything is working, but when i’m trying to build the files using the IDE (CodeBlocks, Eclipse etc…) i’m getting these errors:

/home/hadar/Cloud/cernbox/HEP/projects/test/MyAnalysis/Root/MyxAODAnalysis.cxx:8: undefined reference to `ROOT::GenerateInitInstance(MyxAODAnalysis const*)' libMyAnalysis.a(MyxAODAnalysis.cxx.o): In function `MyxAODAnalysis::IsA() const': /home/hadar/Cloud/cernbox/HEP/projects/test/MyAnalysis/MyAnalysis/MyxAODAnalysis.h:39: undefined reference to `MyxAODAnalysis::Class()' libMyAnalysis.a(MyxAODAnalysis.cxx.o): In function `MyxAODAnalysis::ShowMembers(TMemberInspector&) const': /home/hadar/Cloud/cernbox/HEP/projects/test/MyAnalysis/MyAnalysis/MyxAODAnalysis.h:39: undefined reference to `MyxAODAnalysis::Class()' libMyAnalysis.a(MyxAODAnalysis.cxx.o):(.rodata._ZTV14MyxAODAnalysis[_ZTV14MyxAODAnalysis]+0x1d8): undefined reference to `MyxAODAnalysis::Streamer(TBuffer&)'

The CMake file has all of the root (6.02) lib dir configured properly. What am i doing wrong?


It seems like the generated dictionary was not added into the library or executable. Can you attach the CMakeLists.txt file?

CMakeLists.txt (4.5 KB)

I don’t have any generated dictionary, while trying to generate one i’ve stumbled upon too many errors. Also i’m looking for an automotive way to do that.

OK, solved by generating the dictionary by hand for every class