Error on "‘off_t’ has not been declared" #13

Open
ngty opened this Issue May 15, 2012 · 1 comment

Projects

None yet

2 participants

@ngty

I'm curious if anyone has come across "‘off_t’ has not been declared" error, here's the dump i got:

g++ -g -D_FILE_OFFSET_BITS=64 -I. -I/usr/local/include -c local_gridfile.cpp
In file included from local_gridfile.cpp:1:0:
local_gridfile.h:31:44: error: ‘off_t’ has not been declared
local_gridfile.h:32:36: error: ‘off_t’ has not been declared
local_gridfile.cpp:7:5: error: prototype for ‘int LocalGridFile::write(const char, size_t, off_t)’ does not match any in class ‘LocalGridFile’
In file included from local_gridfile.cpp:1:0:
local_gridfile.h:31:7: error: candidate is: int LocalGridFile::write(const char
, size_t, int)
local_gridfile.cpp:46:5: error: prototype for ‘int LocalGridFile::read(char, size_t, off_t)’ does not match any in class ‘LocalGridFile’
In file included from local_gridfile.cpp:1:0:
local_gridfile.h:32:7: error: candidate is: int LocalGridFile::read(char
, size_t, int)
make: *** [local_gridfile.o] Error 1

I'm willing to fix it, but i'm at a lost.

@epitron

I fixed this problem by putting this line at the top of local_gridfile.h:

#include "sys/types.h"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment