This question has been answered many many times....
one last time.
"Renaming fpos_t variables in SdBaseFile.h and SdBaseFile.cpp to another name like filepos_t fixes it fully.
The issue is that old versions of marlin used the variable name fpos_t but newer version of Arduino grabbed this name as a reserved structure causing the old marlin to fail to compile."