Can't figure out your problem. Must be your compiler, this works just fine with Pelles C under Windows XP.
// PellesC
#include <stdio.h>
#include <math.h>
int main()
{
int x = log(8)/log(2);
printf("x = %d\n", x); // result is x = 3
getchar(); // wait
return 0;
}