hello ?
gcc fmodtest.c
i got :
/tmp/cclMGDI0.o: In function main': /tmp/cclMGDI0.o(.text+0x24): undefined reference to
fmod’
/tmp/cclMGDI0.o(.text+0x5c): undefined reference to fmod' /tmp/cclMGDI0.o(.text+0x94): undefined reference to
fmod’
/tmp/cclMGDI0.o(.text+0xcc): undefined reference to `fmod’
collect2: ld returned 1 exit status
the fmodtest.c is :
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main( void )
{
printf( “%f\n”, fmod( 4.5, 2.0 ) );
printf( “%f\n”, fmod( -4.5, 2.0 ) );
printf( “%f\n”, fmod( 4.5, -2.0 ) );
printf( “%f\n”, fmod( -4.5, -2.0 ) );
return EXIT_SUCCESS;
}
the “math.h” have alread been included ,why still is there this erro? and i have found “math.h” in /usr/include director , what can i do ?
thanks !