I have the following two functions and when compiling, I am face with the error in the title.
double getIdf(FileList fl, int D){
double fileCount = countFiles(fl); //todo countfiles
double temp = fileCount/D;
double idf = log10(temp);
return (fabs(idf));
}
double countFiles(FileList fl){
if (fl == NULL){
printf("countFiles FL does not exist\n");
return 0;
}
double count = 0;
FileList curr = fl;
while (curr != NULL) {
count++;
curr = curr->next;
}
return count;
}
However, if I change the log10 function to log10(5.5) it would work.
double getIdf(FileList fl, int D){
double fileCount = countFiles(fl); //todo countfiles
double temp = fileCount/D;
double idf = log10(5.5);
return (fabs(idf));
}
I am compiling with -lm.
Whats wrong here?