Hi,
I don’t understand why I can’t manage to have a tree with working variable length array.
I tried to follow the Event example and tried to write a very simple program to use a variable length array of Int_t but root complains when trying to access the variable length array
in an interactive session.
The tar file attached contains all the files of my working directory (very short code)
simple_event.h contains class definition
simple_event.cxx is the implementation of a method of class simple_event to fill the variable length array
build_simple_root.cxx builds a root file containing a tree built with simple_event class
make_simple is the makefile I use to compile the code (generating the dictionary, and a dinamically linkable file from the dictionary and the class implementation)
root complains with commands like
t->Draw(“hits”)
where t is the tree built by my program and hits is the branch with the variable length array.
I tried.
I substituted all the UInt_t with Int_t in my class definition and implementation;
it still doesn’t work.
Could it be something to do with the generation of the dictionary, the pragma directives?!
Indeed to use Int_t was necessary (anyway my instinct would be to use an unsigned int as an array index).
My second post saying it was still not working was due to an overlapping mistake I did; before opening the file in the root session I called:
gSystem->Load(“simple_event_dll.so”)
'cause root was warning for the absence of the dictionary.
And if you do that it causes a segmentation violation:
/usr/local/gcc-alt-3.2/bin/c++filt: unknown demangling style 'gnu-new-abi’
If I don’t load that dll, it works (with your correction).
So my simple_event_dll.so is not doing a good job.
Many thanks indeed.
Gianluca
PS: I recently started using ROOT and I find it amazing.