Dear Martin, About namespace, you need to add following pragmas. Please refer to doc/ref.txt in cint package about those pragmas. #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ nestedclasses; #pragma link C++ nestedtypedefs; #pragma link C++ class mine::MyClass; #pragma link C++ class mine; #endif And when you refer to the class root> .class mine::MyClass or root> using namespace mine; root> .class MyClass Thank you Masaharu Goto > >Dear Rooters, > >I would like to add classes to cint, to make them available in the >interpreter. My classes are, however, in a namespace. >I did not find on the root www site how to do this, and I did >not manage. Does anyone know how to do this? >I am working on HP_UX 10.20 with aCC. >Root Version 2.22/10 (28 July 1999), >Cint version 5.14.10 (Jul 20 1999) > >When my class did not work, I went back to the MyClass example in >http://root.cern.ch/root/CintGenerator.html. > >First without any namespace. > >rootcint -f maindict.cxx -c -p MyClass.h >Works fine. > >Then I put MyClass in namespace 'mine'. Then rootcint gives the following 'Note': > >rootcint -f maindict.cxx -c -p MyClass.h >Note: link requested for unknown class MyClass FILE:./G__autoLinkDef.h LINE:7 > >and cint does not know about the class, nor the namespace: > >root [1] .class MyClass >Error: class,struct,union or type MyClass not defined FILE: LINE:0 >*** Interpreter error recovered *** >root [3] .class mine::MyClass >Error: class,struct,union or type mine not defined FILE: LINE:0 >Error: class,struct,union or type mine not defined FILE: LINE:0 >Error: class,struct,union or type mine not defined FILE: LINE:0 >Error: class,struct,union or type mine::MyClass not defined FILE: LINE:0 >*** Interpreter error recovered *** >root [4] .class mine >Error: class,struct,union or type mine not defined FILE: LINE:0 >*** Interpreter error recovered *** > > >So I added my own mainLinkDef.h file containing: > >#ifdef __CINT__ > >#pragma link off all globals; >#pragma link off all classes; >#pragma link off all functions; > >#pragma link C++ class mine::MyClass; > >#endif > >and try again: >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET