[ROOT] problem with constructors of user defined classes

From: Guido Gagliardi (guido.gagliardi@ge.infn.it)
Date: Thu May 13 2004 - 18:49:08 MEST


Hi ,

i have a problem in calling from the interactive session of ROOT the 
non-default constructors of my user defined classes.
I have a class with the constructor:

RootDBField(string name);

into a namespace PixLib;

If i type in the interactive session:

PixLib::RootDBField r("test")

i get the error:

root [5] PixLib::RootDBField rf("prova")
Error: Can't call RootDBField::RootDBField("prova") in current 
scope:1le) LINE
Possible candidates are...
Error: class,struct,union or type RootDBField not defined  
FILE:(tmpfile) LINE:1
filename       line:size busy function type and name
*** Interpreter error recovered ***

however, if i get the longer way:

root [2] std::string * s = new std::string("prova")
root [3] PixLib::RootDBField* r = new PixLib::RootDBField(*s,0)

the object is correctly instantiated, and i can use it

Where is my error?
(note that also:

std::string s("prova")

do not works, and give the same kind of error "Can't call....")

Thank you
Guido



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET