The error message was:
fmod' undeclared (first use this function)

At the beginning of the cpp file, I have this stmt
#include <cmath.h>

Thanks,