I've been trying to use the example for the exp-function of math.h:
1 2 3 4 5 6 7 8 9 10 11 12 13
/* exp example */
#include <stdio.h>
#include <math.h>
int main ()
{
double param, result;
param = 5.0;
result = exp (param);
printf ("The exponential value of %lf is %lf.\n", param, result );
return 0;
}
on three different computers (compiled every time with the command " gcc -o exp exp.c "), and in two instances I always get the error:
1 2 3
/tmp/cc2HG2Tq.o: In function `main':
exp.c:(.text+0x21): undefined reference to `exp'
collect2: ld returned 1 exit status