Hi,
You need to create a dictionary of that struct and the vector containing it. The most straight forward way: put the code into a header file, and load that using
.L CoppieVec.h+
(note the "+" in the end.)
Cheers, Axel.
Feverati wrote on 03/09/2012 10:29 AM:
> Dear experts,
>
> the following code produces an error in my root 5.30/06
>
>
> {
> #include <vector>
> using namespace std;
>
> struct COPPIE{
> int c1;
> int c2;
> double d12;
> };
>
> vector <struct COPPIE> qqq;
> }
>
> It seems that the error is related to the inhability to create a vector
> of my structure. In C++ the code works fine.
> How can I manage to get it working in root?
> The error message follows.
> Thank you,
>
> Giovanni
>
>
>
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/memory:37:
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/memory:38:
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/memory:43:
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/memory:44:
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/memory:45:
> Error: class,struct,union or type structCOPPIE not defined
> /usr/lib64/root/cint/cint/lib/prec_stl/vector:51:
> Error: Function structCOPPIE() is not defined in current scope
> /usr/lib64/root/cint/cint/lib/prec_stl/vector:444:
> Error: Function structCOPPIE() is not defined in current scope
> /usr/lib64/root/cint/cint/lib/prec_stl/vector:444:
> Error: Syntax error /usr/lib64/root/cint/cint/lib/prec_stl/vector:524:
> Error: void type variable can not be declared
> /usr/lib64/root/cint/cint/lib/prec_stl/vector:524:
> Warning: Error occurred during reading source files
> Note: Link requested for undefined class
> vector<structCOPPIE,allocator<structCOPPIE> >::value_type (ignore this
> message) :0:
> Warning: Error occurred during dictionary source generation
> !!!Removing
> /home1/feverati/PROTEINE/programmi/AutoDict_vector_structCOPPIE__cxx_ACLiC_dict.cxx
> /home1/feverati/PROTEINE/programmi/AutoDict_vector_structCOPPIE__cxx_ACLiC_dict.h
> !!!
> Error: /usr/bin/rootcint: error loading headers...
> Error in <ACLiC>: Dictionary generation failed!
> Error: class,struct,union or type structCOPPIE not defined defalloc.h:137:
> *** Interpreter error recovered ***
>
>
>
>
>
>
>
This archive was generated by hypermail 2.2.0 : Fri Mar 09 2012 - 17:50:01 CET