Include tree class in a c++ project

I would like to add a root tree class into my c++ project. I am using kdevelop for my project. My question is what header files and libraries I need to add into my project. I got lots of linker errors now if I just add tree.h and Thank you very much.



I fixed many errors by adding Core, CINT, NET and RIO library. Now I got few errors in the building:

/home/gma/root/lib/root/ undefined reference to `dladdr' /home/gma/root/lib/root/ undefined reference to `dlopen' /home/gma/root/lib/root/ undefined reference to `dlclose' /home/gma/root/lib/root/ undefined reference to ` dlerror' /home/gma/root/lib/root/ undefined reference to `dlsym' collect2: ld returned 1 exit status make[2]: Nothing to be done for `all-am'. make[2]: *** [hellotree2] Error 1 make[2]: Target `all' not remade because of errors. make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 *** Exited with status: 2 ***

Does anyone have some clues how to fix them? Thanks.


Add “-ldl” in your link sequence.
see the list of required libs by typing

root-config --libs or better by replacing your list of libs by

`root-config --libs`
see first pages of the Users Guide


Thanks, Brun. It works. Happy new year!


Now I put a tree class into my project and I want to put my data class into the tree.

I created a data class using ACLIC. I have the header and so files now. When I link my program, I got the following error message

/usr/bin/ld: cannot find -lOTHistData_cpp

But I put the so file path into the linker path. I am wondering how I can solve this problem. Thank you very much.



The library created by ACLiC is named (and it not named you can not access them via -lOTHistData_cpp.
Instead you would need to explicitly use
You can also add a soft link from to
Or you can use TSystem::CompileMacro (the heart of ACLiC) directly which lets give an explicit name to your library.