[ROOT] Templated static data

From: John Pretz (pretz@icecube.umd.edu)
Date: Tue Oct 19 2004 - 19:02:31 MEST


Howdy, roottalk!

There seems to be a problem with rootcint and templated static data.

The attached example shows off the problem.  It involves a class 
template with some static data.  The line of code:
#ifndef __CINT__
template <class T>
Singleton<T>* Singleton<T>::instance = 0;
#endif

fails to make it through rootcint.  If I comment out the '#ifndef 
__CINT__' part the build fails with:
rootcint -f Dict.cxx -c -p Singleton.h LinkDef.h
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: class,struct,union or type  not defined  FILE:Singleton.h LINE:2
Internal error: global function template arg type FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetname():2 FILE:Singleton.h LINE:2
Error: Unexpected EOF G__fgetc() FILE:Singleton.h LINE:2

All the work-arounds that I've found include manipulating the code which 
can't be done if this is an external library.

Would it be possible to have rootcint simply by-pass constructs like 
this since it doesn't need to see the thing to still have the code build 
and work?

For completeness, I'm running root v4.00.08 on a Redhat EL box.

Thanks,

John





This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET