Question

I'm trying to build the PCL library in a 32 bit Windows 7 with MinGW. When building the outofcore module I got several error messages about _fseeki64:

error: there are no arguments to '_fseeki64' that depend on a template parameter, so a declaration of '_fseeki64' must be available

In the octree_disk_container.h file, there is a

#ifndef WIN32
#define _fseeki64 fseeko
#endif

I have tested(generating an #error) and WIN32 is defined at the moment of processing the file. _fseeki64 seems to be available for the compiler as this little test program compiles:

#include "stdio.h"
int main(int argc, char** argv) {
  FILE* f = fopen("C:/a.txt","r");
  if(!f) printf("NOPE");
  int seekret = _fseeki64(f,4,SEEK_SET);
  (void)seekret;
  return 0;
} 

If I define _fseeki64 as fseeko64 the errors disappear and the module compiles, but I'm not sure if the behaviour will be the same with fseeko as was intended to be with fseeki.

So, what can I do in order to use _fseeki64 in this context? Maybe declaring a new base class, putting the #define in there and then calling it like Base<T>::_fseeki64? (got the idea from here)

What are your thoughts?

Was it helpful?

Solution

So the problem seems to be that your MinGW system does #define WIN32, yet _fseeki64 is a Microsoft-ism, not a POSIX thing that MinGW knows about. I think you should use the POSIX behavior on MinGW, which means using fseeko.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top