Re: Warning in <TClass::TClass>: no dictionary for class hitLocation is available

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Sat Jul 10 1999 - 02:58:54 MEST


 Hello Chris,

  ROOT classes can not be used "stand alone". One has to create TROOT global object
  (at least) to control.  Have a look at the ROOT main subroutine or any
 "stand-alone" program from the "test" subdirectory.
  When you run ROOT those essential global objects are supplied by main root program.
  The Windows DLL is aka "UNIX" stand-alone program, This means creating your 
  "stand-alone" DLL you should follow the rules of creating ROOT-base stand-alone code.
  (see test\hsimple.C as a pattern).

//______________________________________________________________________________
int main()
{
  TROOT simple("simple","Test of histogramming and I/O");
  return hsimple();
}

  My guess your DLL should contain the global instance of the TROOT (of course such DLL can not be 
  loaded into the "regular" ROOT session)
  Therefore another "more universal solution" is to introduce an extra method /subroutine instantiating
  TROOT object and call this method / subroutine somewhere from your Java-front end just before that
   loads your  DLL's (or may be better one should create a separate DLL with this subroutine and load
   it first  by  your frond-end). This way your "main" DLL will be completely transparent.

   This "small" DLL should initialize ROOT the way the main ROOT does. After that you can load any
   number of your own ROOT-based DLLs. (I think this way you will end up by loading very root.exe as
   your "top" DLL.  Just try this  for fun. May be it is the simplest solution you need change nothing but 
   add one line of the code for your front-end)

  Something  like:

 #include <TROOT.h>
  void InitRoot() { new TROOT ("XDFTIterface","Test"); }


  But it should work unless  if you want to use some ROOT graphical features or command-line
  interface.

  If you do the solution will be more complicate.

  Anyway I hope this helps.

> hi rooters!!  I have been making a dll for cdf event writing into root (a
> huge change of pace! ;), and i cannot seem to get past this error.  i have
> tried repeatedly to rootcint the files with the command:
> 
> Q:\root\dev\XFTInterface>rootcint -f hitLocationcint.cpp -c hitLocation.h
> hitLocationlinkd
> ef.h
> Note: operator new() masked 1c
> Note: operator delete() masked 1c
> 
> but every time i run the java-front end that loads this dll, i get the
> general exception error, memory could not be "read", and the prompt leaves
> me this line
> 
> Warning in <TClass::TClass>: no dictionary for class hitLocation is available
> 
> if i run root and load another dll with the exact same files loaded for the
> class, and do a ".class hitLocation" i get something rather logical:
> 
> ===========================================================================
> class hitLocation
>  size=0x18
>  (tagnum=251,voffset=-1,isabstract=0,parent=-1,gcomp=0,=~cd=0)
> List of base class--------------------------------------------------------
> 0x0        public: TObject file://Basic ROOT object
> List of member variable---------------------------------------------------
> Defined in hitLocation
> 0xc        int layer
> 0x10       int cellNumber
> 0x14       int wire
> 0x0        private: static TClass* fgIsA
> List of member function---------------------------------------------------
> Defined in hitLocation
> filename       line:size busy function type and name
> (compiled)        0:0    0 public: hitLocation hitLocation(void);
> (compiled)        0:0    0 public: const char* DeclFileName(void);
> (compiled)        0:0    0 public: int DeclFileLine(void);
> (compiled)        0:0    0 public: const char* ImplFileName(void);
> (compiled)        0:0    0 public: int ImplFileLine(void);
> (compiled)        0:0    0 public: Version_t Class_Version(void);
> (compiled)        0:0    0 public: TClass* Class(void);
> (compiled)        0:0    0 public: void Dictionary(void);
> -- Press return for more -- (input [number] of lines, Cont,Step,More)
> (compiled)        0:0    0 public: virtual TClass* IsA(void) const;
> (compiled)        0:0    0 public: virtual void
> ShowMembers(TMemberInspector& insp,char* parent);
> (compiled)        0:0    0 public: virtual void Streamer(TBuffer& b);
> (compiled)        0:0    0 public: hitLocation hitLocation(hitLocation&);
> (compiled)        0:0    0 public: virtual void ~hitLocation(void);
> 
> so i am not sure what i have done wrong.  Any ideas would be greatly
> appreciated.  Also, if there is any way to get a detailed description of
> this error and what causes it, i would be on cloud nine.  this has popped
> up before, but it always "magically" went away.  thanks!!!
> 
> 
> 
> chris
> 
> "schrodinger had to take his cat to the vet, or did he?" - unknown
> 
> chris garcia
> cdf group, the ohio state university
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:35 MET