Warning in <TClassTable::Add>: class TFile already in

It seems you also have two ROOT versions mixed (one set of libraries in “/opt/root/lib/” and another one in “/opt/root-5.34.30.patches/lib/”).

ROOT 5.34/30 is very old. Try the head of the v5-34-00-patches branch for ROOT 5 or the newest ROOT 6 release.

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).