The problem lies in the inline function implementations for _lseeki64()
and _telli64()
, both of which use _fileno()
, and both of which precede the prototype declaration for _fileno()
itself, within the same header file; this causes a fatal error in C++ compilation units, because C++ requires the prototype to be in scope at point of use.
The obvious solution is to rearrange the header file, to ensure that all necessary function prototypes are already in scope, before implementing the inline functions.