Linux-SWAT
Forum Addict!
- Joined
- Feb 13, 2010
- Messages
- 9,194
Thought it was more complicated.
--edit:
! C noob warning !
What am I doing wrong ?
cc get.c
get.c: In function ‘main’:
get.c:6:5: warning: implicit declaration of function ‘getrandom’ [-Wimplicit-function-declaration]
r=getrandom(1,1,1);
^
/tmp/ccYYdDpw.o: In function `main':
get.c.text+0x18): undefined reference to `getrandom'
collect2: error: ld returned 1 exit status
--edit:
! C noob warning !
What am I doing wrong ?
Code:
#include <stdio.h>
#include <linux/random.h>
int main() {
int r;
r=getrandom(1,1,1);
printf("le random: %d",r);
return 0;
}
cc get.c
get.c: In function ‘main’:
get.c:6:5: warning: implicit declaration of function ‘getrandom’ [-Wimplicit-function-declaration]
r=getrandom(1,1,1);
^
/tmp/ccYYdDpw.o: In function `main':
get.c.text+0x18): undefined reference to `getrandom'
collect2: error: ld returned 1 exit status
Last edited: