Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with make command in Ubuntu(Linux). The error is below #4

Open
Anubhawn opened this issue Jul 23, 2018 · 1 comment

Comments

@Anubhawn
Copy link

k-means/k-means$ make
gcc -c -w -D_LARGEFILE_SOURCE -D_ANSI_SOURCE -std=c99 -Wall -Wextra -pedantic -O3 -DNDEBUG gettimeofday.c -o gettimeofday.o
gettimeofday.c:35:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘epoch’
static const unsigned __int64 epoch = UINT64CONST(116444736000000000);
^
gettimeofday.c:44:1: error: conflicting types for ‘gettimeofday’
gettimeofday(struct timeval * tp, struct timezone * tzp)
^
In file included from gettimeofday.c:31:0:
/usr/include/x86_64-linux-gnu/sys/time.h:71:12: note: previous declaration of ‘gettimeofday’ was here
extern int gettimeofday (struct timeval *__restrict __tv,
^
gettimeofday.c: In function ‘gettimeofday’:
gettimeofday.c:46:5: error: unknown type name ‘FILETIME’
FILETIME file_time;
^
gettimeofday.c:47:5: error: unknown type name ‘SYSTEMTIME’
SYSTEMTIME system_time;
^
gettimeofday.c:48:5: error: unknown type name ‘ULARGE_INTEGER’
ULARGE_INTEGER ularge;
^
gettimeofday.c:52:11: error: request for member ‘LowPart’ in something not a structure or union
ularge.LowPart = file_time.dwLowDateTime;
^
gettimeofday.c:52:31: error: request for member ‘dwLowDateTime’ in something not a structure or union
ularge.LowPart = file_time.dwLowDateTime;
^
gettimeofday.c:53:11: error: request for member ‘HighPart’ in something not a structure or union
ularge.HighPart = file_time.dwHighDateTime;
^
gettimeofday.c:53:32: error: request for member ‘dwHighDateTime’ in something not a structure or union
ularge.HighPart = file_time.dwHighDateTime;
^
gettimeofday.c:55:33: error: request for member ‘QuadPart’ in something not a structure or union
tp->tv_sec = (long) ((ularge.QuadPart - epoch) / 10000000L);
^
gettimeofday.c:55:45: error: ‘epoch’ undeclared (first use in this function)
tp->tv_sec = (long) ((ularge.QuadPart - epoch) / 10000000L);
^
gettimeofday.c:55:45: note: each undeclared identifier is reported only once for each function it appears in
gettimeofday.c:56:38: error: request for member ‘wMilliseconds’ in something not a structure or union
tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
^
Makefile:18: recipe for target 'gettimeofday.o' failed
make: *** [gettimeofday.o] Error 1

@killerray
Copy link

FILETIME、SYSTEMTIME,and so on are API struct of WIN32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants