Re: Cant list/debug pointer to a class (CINT)

From: Valery Fine (Valeri.Faine@cern.ch)
Date: Tue May 20 1997 - 16:35:40 MEST


On 20 May 97 at 15:16, Otto Schaile wrote:


> Dear roots,
> seems on cant see pointers to class with CINT.
> Suppose the following simple (working)  macro:
> 
> class TH1F;
> class XX {
> public:
>   XX();
>   void Drawhist();
>   TH1F *h1;
> };
> 
> XX::XX(){
>  h1 = new TH1F("h1","xx",10,0.,10.);
>  for (int i=0; i < 10 ; i++){ 
>    h1->Fill(i,i);
>  }
> }
> 
> XX::Drawhist(){
>  h1->Draw();
> } 
> 
> now I do:
> .L XX.C
> .b XX::Drawhist
> XX *x=new XX()
> b->Drawhist

  Are you sure it is b->Drawhist not just xx->Drawhist();

> .l (or .g) h1
> Variable h1 not found
> 
> (I have off course a more complicated one which doesnt work)
> 

  I took your file, then I did:

root [3] .L xx.cc
root [4] .b XX::Drawhist
Break point set to line 16 xx.cc
root [5] XX *nnn = new XX();
root [6] nnn->Drawhist();

16   XX::Drawhist(){
17    h1->Draw();
FILE:xx.cc LINE:17 cint>
Warning in <MakeDefCanvas>: creating a default canvas with name c1
root [7]

  and got a very nice picture. 

  I was enable to reproduce your problem, please send us further 
information.

              Valery
     Valery
=================================================================
Dr. Valery Fine                  Telex : 911621 dubna su
    -----------
LCTA/Joint Inst.for NuclearRes   Phone : +7 09621 6 40 80
141980 Dubna, Moscow region      Fax   : +7 09621 6 51 45
Russia                           mailto:fine@main1.jinr.dubna.su                              

Dr. Valeri Faine
    ------------                 Phone: +41 22 767 6468
CERN                             FAX  : +41 22 767 7910
CH-1211 Geneva, 23               mailto:fine@mail.cern.ch 
Switzerland                      http://nicewww.cern.ch/~fine
                                 



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