atan() in QNX 6.21 ?

Hi Community !

I try to run following little code

#include <signal.h>
#include <stdlib.h>
#include <math.h>
#include <sys/neutrino.h>

#define CNT_TIME 40
#define PI 3.14159265159

double wert = 0.01;
double result = 0.0;

void alrmh();
int main( void )
{

signal(SIGALRM, alrmh);
alarm(CNT_TIME);

while( 1 )
    {
    result=atan(wert);
    wert = wert + 0.01;
    result = result / PI;
    }

return (EXIT_SUCCESS);
}

void alrmh() { exit(EXIT_SUCCESS); }

and always have problems with atan()

gcc -g -o reinti6 reinti6.c
/tmp/ccQhyMoy.o: In function main': /root/reinti6.c:37: undefined reference to atan’
collect2: ld returned 1 exit status
make: *** [reinti6] Error 1

what’s the reason for this???

Thank You !!

try to link with the math library:

gcc -g -o reinti6 reinti6.c -lm

Hi noc !!!

Brilliant all works perfect now !!!

Thank you !!!