Why the error indicate TTree::TTree not defined?

when i make a garfield++ project based on root, if not insert the code below:
TTree *e_position=new TTree(“e”,“E Position”);




the program worked well.

wher the code up insert(with the header file <TTree.h> on) :
the error occurs below:
signal.C:(.text+0x561): undefined reference to `TTree::TTree(char const*, char const*, int, TDirectory*)’

it seems TTree class constructor function is no found, but when use root program only the TTree class
works well, how the mistake occurs? please help me, thanks!

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.22/06
Compiler: Gcc 9.3.0

You need to link against libTree.

the code #include <TTree.h> has appended

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