Re: problem with STL vector

From: Feverati <feverati_at_lapp.in2p3.fr>
Date: Fri, 9 Mar 2012 16:36:52 +0100


Thank you, this helped a lot.

Giovanni

On 09/03/2012 10:36, Axel Naumann wrote:
> 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 ***
>>
>>
>>
>>
>>
>>
>>

-- 
Dr. Giovanni Feverati
Gemini team (biophysics)
Laboratoire de physique theorique
74941 Annecy-le-Vieux,France
tel: 33450091682
feverati_at_lapp.in2p3.fr
Received on Fri Mar 09 2012 - 16:37:00 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 09 2012 - 23:50:01 CET