| try changing
#include <sys/time.h>
to
#include <time.h> sys/time.h under *nix dosn't have anything called localtime() or time() it only has time-structures defined.
And I took teh liberty to reformat your code with adding [code ] [/code ] tags, aswell as moving some of the definitions around, to make it more readable... |