G++ CAN'T FIND METHOD 'getLine(ifstream, string)'

The example use for the function 'getLine' of the c++ standard library, included with 'fstream', is getLine (ifstream, string); .

g++ is telling me it is 'not declared in this scope'.

This is aggrivating me...

I am compiling with MinGW encasing g++.

Please help ASAP.

If you want here's my whole file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main() {
    ifstream _open;
    string data[10000];
    int i = 0;
    _open.open("hi.txt");
    while (!_open.eof()) {
        while (getLine(_open, data[i])) {//RIGHT HERE!!
            i++;
        }
        _open.close();
    }
    for (int i = 0; i < (sizeof(data)/sizeof(data[0])); i++) {
        cout << data[i];
    }
    cin >> data[0];
}


Thanks in advance.
getline, not getLine

You'll find no identifiers with capital letters in the standard library.

What does this have to do with Windows?
Oh.

Well getLine is what the tutorial page says, I just went with that.

And Windows because I have a gcc enviorment with windows, and have been having quite trouble setting it up. I have had problems with setting the path, which I found out only registers a limited amount of paths because windows is trying to make it 'MS-DOS compatable' (give me a f*ing break). So I was wondering if this wasn't just a syntax error and if I set my enviorment up wrong.

Thanks anyway.
Last edited on
demoylan wrote:
Well getLine is what the tutorial page says, I just went with that.

Which tutorial? If it says getLine with capital L the tutorial needs to be changed.
Last edited on
oh.

Maybe it is just I got confused because the l has a bar under it.

Thanks
Topic archived. No new replies allowed.