32 bit Windows and the 2GB file size limit (C with fseek and ftell)

后端 未结 4 646
情书的邮戳
情书的邮戳 2020-12-17 03:28

I am attempting to port a small data analysis program from a 64 bit UNIX to a 32 bit Windows XP system (don\'t ask :)). But now I am having problems with the 2GB file size l

4条回答
  •  渐次进展
    2020-12-17 04:28

    And for gcc, see SO question 1035657. Where the advice is compile with the flag -D_FILE_OFFSET_BITS=64 so that the hidden variable(s) (of type off_t) used by the f-move-around functions is(are) 64-bits.

    For MinGW: "Large-file support (LFS) has been implemented by redefining the stat and seek functions and types to their 64-bits equivalents. For fseek and ftell, separate LFS versions, fseeko and ftello, based on fsetpos and fgetpos, are provided in LibGw32C." (reference). In recent versions of gcc, fseeko and ftello are built-in and a separate library is not needed.

提交回复
热议问题