CINT file handle support

View: New views
2 Messages — Rating Filter:   Alert me  

CINT file handle support

by Louis-35 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What additional cint sources do I need to compile for file IO support?
If I try to run a little example:
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open()) {
 while (! myfile.eof()) {
  getline (myfile,line);
  cout << line << endl;
 }
 myfile.close();
}
else cout << "Unable to open file";
return 0;
}

It stops with this error message:
C:\Users\Lis\Documents\work\cint_learn>cint.exe -IC:\cint\inc
-IC:\cint\include
-IC:\cint\stl fileRead.cxx
Error: Function getline(myfile,line) is not defined in current scope
fileRead.c
xx(14)
!!! return from main() function

How to solve this?

Thanks and Greets Louis.



Re: CINT file handle support

by Philippe Canal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Louis,

You may not have compiled into the CINT library the file under cint/src/dict
In particular you will need those 4 files:

cint/src/dict/Apiif.cxx  cint/src/dict/longif3.cxx  
cint/src/dict/stdstrct.cxx  cint/src/dict/vc7strm.cxx

Cheers,
Philippe.