Strange error when reading vector<int>

Dear rooters,

With the attached files I’m having the following compilation warnings

[size=85]Dict.cc:258:10: warning: ‘const’ qualifier on reference type ‘vector<int, allocator >::reference’ (aka ‘int &’) has no effect [-Wignored-qualifiers]
const vector<int,allocator >::reference obj = ((vector<int,allocator >) G__getstructoffset())->at((vector<int,allocator >::size_type) G__int(libp->p…
^~~~~~
Dict.cc:368:10: warning: ‘const’ qualifier on reference type ‘vector<int, allocator >::reference’ (aka ‘int &’) has no effect [-Wignored-qualifiers]
const vector<int,allocator >::reference obj = ((vector<int,allocator >
) G__getstructoffset())->operator[]((vector<int,allocator >::size_type) G__int…
^~~~~~
2 warnings generated.[/size]

and run time error;

[size=85]Error in TTree::SetBranchAddress: Unable to determine the type given for the address for “mc_pdgId”. This is probably due to a missing dictionary, the original data class for this branch is vector.

*** Break *** segmentation violation
Generating stack trace…
0x0000000000000001 in [/size]

This is sort of strange because I do exactly the same, in order to read vector variables and having no error with them. Only with int vectors.

Any help would be appreciated.

Best,
Bora
Makefile.txt (591 Bytes)
test.cc (1.19 KB)
LinkDef.h (554 Bytes)

“./input_file.root” is missing.
btw. which root version, on which system and with which compiler are you using?
p.s. your “clean” target is missing “rm -f Dict*”

Hi,

input file is too large to attach but I can assure you that the variable type is vector.

I use ROOT 5.34/14 on OS X Yosemite 10.10.5 with Xcode 6.4.

Best,
Bora

Try 5.34/32 (or maybe even better the head of the v5-34-00-patches branch) or/and 6.05/02.

I’m not really sure if it helps but try to add, right in the beginning of your main:
TApplication a(“a”, 0, 0);

Hi. It works with 6.04/02. Thank you!