[ROOT] Using ifstream

From: zaldy (zaldy@neutrino.kek.jp)
Date: Sun Aug 29 2004 - 04:02:25 MEST

Dear Folks,

When not using Root Application, I used to write a code using ifstream in 
COMPILED Code like this below. Things are just Ok. But when I used this 
using root, I get a compilation error message as I also shown below.

What is wrong with my code?
Any Hint please.

I have attached a small tar file reproducing this problem.

I am using root Version   3.10/01  28 November 2003 
with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Thanks in advance.

===========================Compilation error message
g++ -O -Wall -fPIC -Wno-deprecated -D_REENTRANT 
-I/CERN_SOFT/myroot/include/root   -c -o HitInfo.o HitInfo.cc
In file included from HitInfo.cc:3:
HitInfo.hh:37:39: warning: no newline at end of file
HitInfo.cc: In member function `void HitInfo::Write_To_RootFile(char*)':
HitInfo.cc:19: aggregate `std::ifstream fin' has incomplete type and 
cannot be 
make: *** [HitInfo.o] Error 1

============================Sample  code
#include <fstream.h>
#include <ifstream.h>

ifstream in;

  Int_t rn, spl;
  while(fin.eof() == false) {
   fin >> rn >> spl; 


Zaldy A. Nawang

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