Std containers in TTree compiled with gcc/clang

Hi, I am trying to compile my own code separately using a Makefile to try to debug a seg fault. Previously my code was run using “root mycode.C+” to compile it, which obeyed the auto-generated dictionary thing in order to store std containers and custom classes in the TTree:

#ifdef __MAKECINT__ #pragma link C++ class vector<float>+; #endif
Now if I try to compile my code with clang or gcc, it ignores these blocks and my programs always complain about the class or type being unknown to ROOT. What is the solution in this case?

As an example, I use the ROOT tutorial hvector.C. I modify it slightly by adding this function at the bottom:

int main() { write(); read(); return 0; }

and I compile with this command:

(note that g++ uses exactly the same syntax). I get no compilation errors, but when I run it, this is the output:

[code]Error in TTree::Branch: The pointer specified for vpx is not of a class or type known to ROOT
Error in TTree::Branch: The pointer specified for vpy is not of a class or type known to ROOT
Error in TTree::Branch: The pointer specified for vpz is not of a class or type known to ROOT
Error in TTree::Branch: The pointer specified for vrand is not of a class or type known to ROOT
Warning in TCanvas::Constructor: Deleting canvas with same name: c1
Error in TTree::SetBranchAddress: unknown branch -> vpx

*** Break *** segmentation violation
Generating stack trace…
0x00007fff9498b5fd in start (in libdyld.dylib) + 1
[/code]

So again, what is the solution? Is there some code to add to hvector.C, or some extra options to pass to clang++ when compiling? Thanks for the help.

Jean-François