TTree problems with branching I guess

Hello everyone!
I am trying to to copy a TTree and do some analysis with it.
TTree is created by converting .dat data. It is separated into branches as so:

  t->Branch("px",px,"px[n]/F");
  t->Branch("py",py,"py[n]/F");
  t->Branch("pz",pz,"pz[n]/F");

where n is just a large number defined in code.
It is created correctly if viewed from TBrowser. A normal TTree with correct branches and so on.
When then I try to read this Tree in a different program:

    TFile *f = new TFile("data.root");
    TTree *t1 = (TTree*)f->Get("TreeFile");
    t1->SetBranchAddress("px",&px);
    t1->SetBranchAddress("py",&py);
    t1->SetBranchAddress("pz",&pz);

where data.root is my TTree file i created.
I get a couple of warnings:

In module 'Tree':

**/root_v6.32.06/include/TTree.h:597:29:** **warning:** **inline function 'TTree::SetBranchAddress<float>' is not defined [-Wundefined-inline]**
template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = nullptr) {

And then code crushes printing:

/path/to/code**note:** used here
[runStaticInitializersOnce]: Failed to materialize symbols:
--"a lot of different symbols"--
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { ____orc_init_func.cling-module-100 }) }
cling JIT session error: Failed to materialize symbols: { (main, { __Z14"nameofcode"v }) }

I am not sure if this mistakes is related with previous warnings, but it occurred only now.
Root is downloaded and assembled from pre-compiled binary distribution from the official website.
Would be glad for any tips!
ROOT Version: root_v6.32.06
Platform: macOS 14.6.1
Compiler: clang++

Hi Eduard,

Welcome to the ROOT community!
Sorry to read things did not work out of the box for you.
I think there is a problem with the installation: do you manage to run ROOT and do something with it?

Cheers,
Danilo

Hi Danilo!

Thank you for your answer! Root was successfully working for last couple of weeks - same version and platform. Also some other root programs do run on it without any problems.

Dlin E.

Hello,

What is the minimal running reproducer that triggers the bug in an otherwise fully working ROOT installation?

Best,
D

Hello,

i checked for a while and the line that gives that kind of an error is:

ios_base::sync_with_stdio(false);

which should just work as a command to the compiler to not synchronize the standard C++ streams to C streams.
If I try to delete it the compiler answer changes to:


IncrementalExecutor::executeFunction: symbol '_ZNSt3__16__math3sinB8ne180100Ef' unresolved while linking [cling interface function]!

You are probably missing the definition of std::__1::__math::sin[abi:ne180100](float)

Maybe you need to load the corresponding shared library?

Which seems like a different kind of a mistake.
Thank you,
Dlin E