Masahiro Sugaya---------------------------
Address: 1-1 Oho, Tsukuba, Ibaraki 305-0801 Japan
Office: 0298-79-6123
Mail: sugayam@post.kek.jp
From: Rene Brun <brun@pcbrun.cern.ch>
Subject: Re: [ROOT] A problem in bstring.h
Date: Sun, 20 Jan 2002 10:11:14 +0100 (MET)
Message-ID: <Pine.LNX.4.04.10201201008210.11432-100000@pcbrun.cern.ch>
Hi rooters.
Well I didn't write enough infomation in the previous mail.
My root version is the latest version fetched from CVS.
I changed the script as Brun said. But the error occurs.
------test.C--------
#include <string>
void test() {
ifstream fi("test.dat");
//cout << fi.is_open() << endl;
string t;
fi >> t;
cout << t << endl;
}
root[1] .x test.C
Error: Symbol i is not defined in current scope FILE:bstring.h LINE:2523
Error: Failed to evaluate i.operatorvoidError: Binary operator oprand missing FILE:bstring.h LINE:2523
*** Interpreter error recovered ***
> Hi Masahiro,
>
> There are several functions of ifstream currently not accessible from
> CINT.
> Masa may want to comment on this.
>
> You can run your test in the following way:
>
>
>
> Rene Brun
>
> On Sun, 20 Jan 2002 sugayam@post.kek.jp wrote:
>
> >
> > Hi rooters,
> > I have some problems using fstream in the root script.
> >
> > My root ver. is 3.02/07. linux redhat 6.1.
> >
> > The probrem is that next script test.C doesn't work well.
> > -----test.C----------
> > {
> > ifstream fi("test.dat");
> > cout << fi.is_open() << endl;
> > string t;
> > fi >> t;
> > cout << t << endl;
> > }
> >
> > The error output is
> > root[1] .x test.C
> > ==> ifstream::is_open () in current scope FILE:test.C LINE:3
> > ==> Possible candidates are...
> > ==> Possible candidates are...
> > ==> filename line:size busy function type and name (in ifstream)
> > ==> filename line:size busy function type and name (in fstreambase)
> > ==> filename line:size busy function type and name (in ios)
> > ==> filename line:size busy function type and name (in istream)
> > ==> filename line:size busy function type and name (in ios)
> > ==> *** Interpreter error recovered ***Possible candidates are...
> > ==> filename line:size busy function type and name (in ifstream)
> > ==> filename line:size busy function type and name (in fstreambase)
> > ==> filename line:size busy function type and name (in ios)
> > ==> filename line:size busy function type and name (in istream)
> > ==> filename line:size busy function type and name (in ios)
> > ==> *** Interpreter error recovered ***
> >
> > So I commented out the line of cout << fi.is_open() << endl;
> > -----test.C----------
> > {
> > ifstream fi("test.dat");
> > //cout << fi.is_open() << endl;
> > string t;
> > fi >> t;
> > cout << t << endl;
> > }
> >
> > but it said
> >
> > root[1] .x test.C
> > ==> Error: Symbol i is not defined in current scope FILE:bstring.h LINE:2523
> > ==> Error: Failed to evaluate i.operatorvoidError: Binary operator oprand missing FILE:bstring.h LINE:2523
> > ==> *** Interpreter error recovered ***
> >
> >
> > Masahiro Sugaya---------------------------
> > Address: 1-1 Oho, Tsukuba, Ibaraki 305-0801 Japan
> > Office: 0298-79-6123
> > Mail: sugayam@post.kek.jp
> >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:39 MET