rootcint chokes on #pragma link C++ function operator << ( ... );

stefan kluth (skluth@mh1.lbl.gov)
Thu, 21 May 1998 16:34:18 -0700 (PDT)


Hi,

I try to give to my class an "operator<<" which I can use in root. I
follow the advice, i.e. I have

friend ostream & operator << ( ostream&, ... )

and in linkdef.h

#pragma link C++ function operator << ( ostream &, ... );

But rootcint (run with -T) gives me a strange error:

LOADING file=H3VLinkDef.h:H3VLinkDef.h:
1 #ifdef __CINT__
2
3 #pragma link off all globals;
4 #pragma link off all classes;
5 #pragma link off all functions;
6
7 #pragma link C++ function operator << ( ostream &, const Hep3Vector &
);
8 #pragma link C++ class Hep3Vector;
9 // #pragma link C++ function operator + ( const Hep3Vector & );
10
11
12 #endif
13 EOF
Error: Unexpected EOF G__fgetstream():2 FILE:H3VLinkDef.h LINE:13
Advice: You may need to use +P or -p option
EOF
EOF
EOF
EOF
EOF
EOF
EOF
EOF
EOF
Error: Unexpected EOF G__fgetc() FILE:H3VLinkDef.h LINE:13
Advice: You may need to use +P or -p option

FILE:H3VLinkDef.h LINE:13

When I try to do the same with "operator+" it seems to work:

LOADING file=H3VLinkDef.h:H3VLinkDef.h:
1 #ifdef __CINT__
2
3 #pragma link off all globals;
4 #pragma link off all classes;
5 #pragma link off all functions;
6
7 //#pragma link C++ function operator << ( ostream &, const Hep3Vector
& );
8 #pragma link C++ class Hep3Vector;
9 #pragma link C++ function operator + ( const Hep3Vector & );
10
11
12 #endif
13 EOF

Any ideas? cheers, Stefan

---Stefan Kluth---------------Lynen Fellow----------------|\--|\-------
- LBNL, MS 50A 2160 - phone: +1 510 495 2376 - |/ |/ -
- 1 Cyclotron Rd. - fax: +1 510 495 2957 - |\/\|\/\|' -
---Berkeley, CA94720, USA-----e-mail: SKluth@lbl.gov------|/\/|/\/|----