I’m learning programming with ROOT. And I have two basic questions after encountered some compiling errors:
(background: project name is “mycode”; header file is “myclass.h” which defines a global object array like this, “class myclass {…} myobj[100]”; subroutine “myclass.C” provides the memeber functions of “myclass” which has myclass.h included, of course; main program is “mycode.cxx”)
- When I copied Makefile from ROOT test programs, I found xxxDict.cxx. what’s the function of xxxDict.cxx? Because I found my program could be compiled without creating this dictionary code, so I deleted it from my Makefile.
So why does it exist?
- Now I want to write my own classes into files, and I found in the User’s Guide that I needed “streamer” method, which is defined in mycodeDict.cxx and was created by rootcint automatically. But after I added mycodeDict.cxx creation and compilation lines into my Makefile, I got “multiple definition” error:
myclass.o: first defined here
mycodeDict.o: multiple definition of ‘myobj’
- My intuition tells me that my problems with ROOT are very simple ones in the eyes of experts and they’re also entangled with my lack of C++ programming experiences and a detailed manual can save me from asking them in this forum.
So, where can I find more detailed manuals on “programming with ROOT/C++” beside the “Guide”?
Thanks for you help!