Hi Imran,
If you run with ROOT versions compiled with KCC, Sun/CC5.2 or gcc3,
the definition of the keywords in,out,app,etc is in class ios_base, not ios.
instead of
ofstream fout("somefile.txt", ios::app)
do:
ofstream fout("somefile.txt", ios_base::app)
Rene Brun
Imran Younus wrote:
>
> Hi everybody,
> I'm using ROOT ver 3.01/06, and I'm trying to open an 'existing' file to
> 'write' using the following
>
> root[0] ofstream fout("somefile.txt", ios::app)
>
> and I get the following errors
>
> Error: class,struct,union or type ios not defined
> FILE:/var/tmp/caaXqa40q_cint
> LINE:1
> Error: class,struct,union or type ios not defined
> FILE:/var/tmp/caaXqa40q_cint
> LINE:1
> Error: Symbol ios::app is not defined in current scope
> FILE:/var/tmp/caaXqa40q_
> cint LINE:1
> *** Interpreter error recovered ***
>
> The above line works fine (as it should, I think) in ROOT ver. 2.23/12. I
> know this problem has been mentioned on roottalk before but I couldn't find
> the solution in the archive. Please let me know what should I do about it
> other than not to try such thing at all (I really want open a .txt file
> :) ). Thanks,
>
> Imran Younus
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:11 MET