I cannot understand why this throws undefined reference to `floor'":
double curr_time = (double)time(NULL);
return floor(curr_time);
Hasn't it been casted to double, which is what floor receives?
You possibly have run in to the infamous -lm
problem: Compile as:
gcc yourfile.c -o out -lm
This is C FAQ 14.3 item as well.