Pointer to own class object

Krieg, M. (Krieg@ihqsrv.etec.uni-karlsruhe.de)
Thu, 26 Feb 98 11:38:00 W


Hi Roots!

I couldn't find a solution of the following problem in the complete ROOT Web
page (including the RootTalk Digest) so I imagine it could be of general
interest:

I have successfully included some own classes into the ROOT-System. The code
compiled and worked well until I added to my code a constructor, that uses a
pointer to a classobject of one of my own classes, lets say 'TOwnClass':

TAnotherOwnClass :: TAnotherOwnClass (TOwnClass* ptr){...}

Something seems to be wrong with the dictionary file created by rootcint,
since I get the following error message of the compiler:

mydict..cpp: no match for 'operator <<(class TBuffer, class TOwnClass*)'

here is a simplified version TOwnClass.h:

#include<iostream.h>
#include"TGraph.h"
class TOwnClass{
private:
int TestVar;
public:
TOwnClass();
~TOwnClass();
void AnyFunction();
};

my LinkDef.h contains the following lines:

#pragma link C++ class TOwnClass!;
#pragma link C++ class AnotherOwnClass!;

(leaving out the exclamation mark at the end of the line or adding a minus,
as well as any combination of both signs didn't change the error message)

What am I doing wrong? Do I have to add any function or operators to the
class definitions? Do I have to inherit TOwnClass of TObject or any other
ROOT class? (I tried that, but without success)?
I hope I gave you all the necessary information, thanks a lot in advance!

Martina
(working with linux and GNU-Compiler)
martina.krieg@etec.uni-karlsruhe.de