[ROOT] argument passing

From: Jan Strube (jstrube@darkwing.uoregon.edu)
Date: Fri Aug 02 2002 - 20:44:16 MEST


Hi !

I have a problem passing arguments to functions. I get errormessages of
the kind "symbol unknown not declared". I have no clue what that could
point to, because I DO NOT HAVE a symbol "unknown", so of course it is
undeclared.
Another errormessage I have a hard time understanding is something like
"symbol event not declared in current scope", although "event" is passed
as an argument to the function.

In order to reproduce this behavior, I wrote a simple script:

Int_t function_test(Int_t ntries=10) {
    gROOT->Reset();

    Int_t IntTest = 100;
    TVector3 *testVec = new TVector3(1.2, 3.4, 5.5);

    functionCall(IntTest);
    calling(testVec);
    return ntries;
}

Int_t functionCall(Int_t t)
{
    for (int i=0; i<t; i++)
	cout << "Number is " << i << " of " << t << endl;
    return 2;
}

void calling(TVector3 *t2)
{
    cout << "TVector3 value is: " << endl;
    cout << "X: " << t2->x() << "\tY: " << t2->y() << "\tZ: " << t2->z();
    cout << endl;
    return;

}

I get the following errormessages:

Error: Symbol TVector3 is not defined in current scope
FILE:function_test.cc LINE:7
Error: Symbol TVector3 is not defined in
current scope  FILE:function_test.cc LINE:7
Error: type TVector3 not
defined FILE:./function_test.cc LINE:7
Warning: Automatic variable TVector3*testVec allocated in global scope
FILE:function_test.cc LINE:7
Error: Undeclared variable TVector3*testVec
FILE:function_test.cc LINE:7
*** Interpreter error recovered ***

What is wrong ?

Thanks a lot in advance

Jan



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:03 MET