Well I have three little problems that I list below:
a) Can the new GUIs be used in Windos 95 ? I tried to use there a program
that works on a HP, but in W95 it does not link. There are some
undefined static class members of TGxxxx classes.
b) I tried to take a look into the event display code of Pasha Murat but I
could only find the linkdef header in the tar file...
c) I want to print a class with the iostream << operator in CINT. This is
what I tried to do
====> Ptest.h <======
#ifndef __PTEST_H__
#define __PTEST_H__
#include <iostream.h>
#include <TObject.h>
class Ptest : public TObject {
private:
int value;
public:
Ptest(int x=0) { value=0; }
~Ptest() {}
void prt (ostream &os);
friend ostream& operator<< ( ostream& , Ptest& );
ClassDef(Ptest,1) // Ptest class
};
ostream& operator<< ( ostream& , Ptest& );
#endif
====> Ptest.cxx <=======
#include "Ptest.h"
ClassImp(Ptest)
void Ptest::prt(ostream &os) {
os << "My value is: " << value << endl;
}
ostream& operator<< ( ostream &os , Ptest &t ) {
t.prt(os);
return os;
}
====> Ptest_Linkdef.h <=====
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class Ptest;
#pragma link C++ function operator<<(ostream &, Ptest &);
#endif
As it is rootcint gives the following error message:
Error: Unexpected EOF G__fgetstream():2 FILE:Ptest_LinkDef.h LINE:13
Advice: You may need to use +P or -p option
Error: Unexpected EOF G__fgetc() FILE:Ptest_LinkDef.h LINE:13
Advice: You may need to use +P or -p option
Now, if I comment out the line
#pragma link C++ function operator<<(ostream &, Ptest &);
rootcint does not complain but, after loading the shared lib. with my class,
root> Ptest xx(4);
root> cout << xx;
does not print anything.
Am I missing anything ? Is it the correct way to do it ?
Thanks,
Carlos
___________________________________________________________________
Carlos Lacasta
^^^^^^^^^^^^^^^
Division PPE
Bat. 161 1-014
CERN
CH 1211 Meyrin/Geneve
Switzerland/Suisse
Tel.: +41 22 7673028
Fax.: +41 22 7677150
WWW : http://wwwcn.cern.ch/~lacasta
___________________________________________________________________