RE: [ROOT]std::ifstream error

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Jun 06 2003 - 22:49:43 MEST


Hi Exaos,

You are most likely using a distribution where the dictionary for
std::string has not been built and/or not loaded yet.  You would need to do:
	cd $ROOTSYS;
	gmake cintdlls
and make sure to do (sometimes in the session):
	#include <string>

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Exaos Lee
Sent: Thursday, May 29, 2003 7:29 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT]std::ifstream error


Dear rooter,
I want to read data from a binary data file and an ascii file. My codes
are below:
-------
...
// Index file: ASCII format, each line containing one event filename
// for processing.
std::ifstream idx_in("event_index.txt",ios::in);
std::ifstream evnt_in;  // Kmax .evnt file stream
std::string   evnt_fn;  // .evnt filename
...
do {
	idx_in >> evnt_fn; // read a filename
	if(evnt_fn.isempty() && idx_in.eof()) break;
	evnt_in.open(evnt_fn,ios::in | ios::binary) ;
	...
} while(!idx_in.eof());
-------
When root reach this line: "idx_in >> evnt_fn;", it warns me:
=======
Error: operator>> not defined for basic_ifstream<char,char_traits<char>
 > FILE:evnt2root.C LINE:67
*** Interpreter error recovered ***
=======
What's wrong with my codes?

Regards

Exaos


#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET