B
Bart Rider
I've written a short c-programm using srand48 and drand48.
After compiling with gcc -
gcc -o foo foo.c -W -Wall -pedantic -ansi
- I get the warnings -
foo.c: In function `main':
foo.c:7: warning: implicit declaration of function `srand48'
foo.c:8: warning: implicit declaration of function `drand48'
-. (The short example is at the end.)
No I wonder why. I checked the man pages and googled for it.
The correct header file, stdlib.h, is included. Even compiling
with switch -lc to explicitely include libary libc does not
make the warnings vanish.
Do I have to include another header file? Or is it system
specific and, thus, maybe OT here.
Thanks in advance,
Bart
/* start file foo.c */
#include <stdlib.h>
#include <time.h>
int main( void ) {
srand48( time(0) );
drand48();
return 0;
} /* of main */
/* end of file foo.c */
After compiling with gcc -
gcc -o foo foo.c -W -Wall -pedantic -ansi
- I get the warnings -
foo.c: In function `main':
foo.c:7: warning: implicit declaration of function `srand48'
foo.c:8: warning: implicit declaration of function `drand48'
-. (The short example is at the end.)
No I wonder why. I checked the man pages and googled for it.
The correct header file, stdlib.h, is included. Even compiling
with switch -lc to explicitely include libary libc does not
make the warnings vanish.
Do I have to include another header file? Or is it system
specific and, thus, maybe OT here.
Thanks in advance,
Bart
/* start file foo.c */
#include <stdlib.h>
#include <time.h>
int main( void ) {
srand48( time(0) );
drand48();
return 0;
} /* of main */
/* end of file foo.c */