RE: [ROOT] STL in the class

From: Jedong Lee (jdlee@fnal.gov)
Date: Fri Jul 18 2003 - 00:10:13 MEST


Hi Philippe,

With #include <vector>, I get different error:

 ----------
root [0] .L vec.C++
Info in <TUnixSystem::ACLiC>: creating shared library /mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./vec_C.so
"/mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./vec.h", line 10: error #864:
          vector is not a template
    vector<double> v_;
    ^

1 error detected in the compilation of "/mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./fileibD55q.cxx".
KCC: Compilation failed.
 ----------

I don't know if this is KCC problem.. Sometimes I am forced to use
<vector.h> instead of <vector> for some reason.


Best,
Jedong


On Thu, 17 Jul 2003, Philippe Canal wrote:

> Hi Jedong,
> 
> Use:
> 	#include <vector>
> instead of the obsolete
> 	#include <vector.h>
> 
> Cheers,
> Philippe.
> 
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Jedong Lee
> Sent: Thursday, July 17, 2003 4:25 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] STL in the class
> 
> 
> 
> Hello,
> 
> I am working on v3_05_04e, with KCC4.0.
> And I'm having a problem with STL vector.
> 
> This is what I get from CINT with the source listed below:
> 
> root [0] .L vec.C++
> Info in <TUnixSystem::ACLiC>: creating shared library
> /mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./vec_C.so
> "/mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./fileonmdDl.h",
> line 44: error #864:
>           allocator is not a template
>   typedef vector<double,allocator<double> >
> G__vectorlEdoublecOallocatorlEdoublegRsPgR;
>                         ^
> 
> 1 error detected in the compilation of
> "/mnt/autofs/misc/b0urpc19.a/jdlee/work/root_test/vector/./fileonmdDl.cxx".
> KCC: Compilation failed.
> 
> 
> Is something wrong in my code?
> 
> Best,
> Jedong
> 
> 
> --------------------------------------------------------------------
> - file vec.h
> --------------------------------------------------------------------
> #include <vector.h>
> #include "TObject.h"
> 
> class vec : public TObject
> {
> public:
>   vec();
>   ~vec();
> 
>   vector<double> v_;
> 
>   ClassDef(vec,1)
> };
> 
> --------------------------------------------------------------------
> - file vec.C
> --------------------------------------------------------------------
> #include "vec.h"
> #include <vector.h>
> 
> #ifndef __CINT__
> ClassImp(vec)
> #endif
> 
> vec::vec(){
>   v_.push_back(10);
> }
> 
> vec::~vec(){}
> 
> --------------------------------------------------------------------
> - file vec_linkdef.h
> --------------------------------------------------------------------
> #ifdef __CINT__
> 
> #pragma link off all globals;
> #pragma link off all classes;
> #pragma link off all functions;
> 
> #pragma link C++ class vector<double>;
> #pragma link C++ class vec;
> 
> #endif
> 
> --------------------------------------------------------------------
> 
> 
> 
> 

-- 


--------------------------------------------------------------------
Jedong Lee                       Department of Physics and Astronomy
630-840-8428                                 University of Rochester
jdlee@fnal.gov                                   Rochester, NY 14627



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET