B
Bart Vandewoestyne
I'm having a .c source file which at the top contains the line
#include <math.h>
In that source file, i declare a function dt which in its body uses
the lgamma function. `man lgamma' on my linux system tells me
that i have to include math.h so it seems like I'm doing the
right thing in order to be able to use the lgamma function.
When I compile the .c file with
$ gcc -ansi -c rand.c
or
$ gcc -Wall -c rand.c
then I get no errors or warnings. When I compile it with
$ gcc -Wall -ansi -c rand.c
I get the warning:
rand.c: In function `dt':
rand.c:544: warning: implicit declaration of function `lgamma'
which seems strange to me. Why am I getting this warning and how do I
resolve this warning? I assume it has something to do with ANSI C or not,
but I'm confused...
Thanks,
Bart
PS: the version of gcc I'm using is gcc (GCC) 3.3.5 (Debian 1:3.3.5-13).
Upgrading to a newer version is no option because I do not have admin rights
to install or upgrade packages on my system.
#include <math.h>
In that source file, i declare a function dt which in its body uses
the lgamma function. `man lgamma' on my linux system tells me
that i have to include math.h so it seems like I'm doing the
right thing in order to be able to use the lgamma function.
When I compile the .c file with
$ gcc -ansi -c rand.c
or
$ gcc -Wall -c rand.c
then I get no errors or warnings. When I compile it with
$ gcc -Wall -ansi -c rand.c
I get the warning:
rand.c: In function `dt':
rand.c:544: warning: implicit declaration of function `lgamma'
which seems strange to me. Why am I getting this warning and how do I
resolve this warning? I assume it has something to do with ANSI C or not,
but I'm confused...
Thanks,
Bart
PS: the version of gcc I'm using is gcc (GCC) 3.3.5 (Debian 1:3.3.5-13).
Upgrading to a newer version is no option because I do not have admin rights
to install or upgrade packages on my system.