2

Just try to compile this c++ code with MINGW

#include <stdio.h>

int main ()
{
    FILE * pFile;
    char file_name[100] = "test";
    pFile = fopen (file_name,"rb");
    fseeko64(pFile, 0, SEEK_END);
    long long file_dim = ftello64 (pFile);
    printf ("File:\n%s\ncontains %I64d bytes:\n", file_name, file_dim);
    return 0;
}

and always get

'fseeko64' was not declared in this scope
'ftello64' was not declared in this scope

Why? What's wrong??

Upd:

I've found reason: "-std=c++11" switch gives this! "-std=gnu++11" OK

user2793013
  • 21
  • 1
  • 3
  • 1
    I've never heard of `fseeko64` or `ftello64`. Are they standard functions? If not your compiler probably doesn't implement them, or implements them outside of `stdio.h`. – Chris Hayes Sep 18 '13 at 20:05
  • possible duplicate of [Get Large File Size in C](http://stackoverflow.com/questions/9026896/get-large-file-size-in-c) – Shafik Yaghmour Sep 18 '13 at 20:07
  • They are part of stdio.h, I can see them there. There are a lot of information about them in google. – user2793013 Sep 18 '13 at 20:17
  • If they are in the `stdio.h` that your compiler is picking, you wouldn't get those errors. What does the preprocessor output look like? – Carl Norum Sep 18 '13 at 20:23
  • 2
    I've found reason: "-std=c++11" switch! "-std=gnu++11" OK – user2793013 Sep 19 '13 at 08:06

0 Answers0