The linker keeps telling me that clock_gettime() is undefined.
I have tried using -lrt but then gcc says that it can't find that either.
Am I missing some extra library I needed to download?
// test.c
#include <time.h>
#include <stdio.h>
int main()
{
struct timespec x;
clock_gettime(CLOCK_REALTIME, &x);
printf("%d\n", x.tv_sec);
return 1;
}
When I try to compile this using GCC with MinGW, it puts out this:
gcc test.c
undefined reference to `clock_gettime'
or
gcc test.c -lrt
cannot find -lrt: No such file or directory