I am having trouble with arc4random on Ubuntu 9.04. I installed the libbsd-dev package, and "man arc4random" does bring up the man page. But if I try to compile this program:
#include <stdio.h>
#include <stdlib.h>
main()
{
int x;
x=arc4random();
printf("%i\n", x);
return 0;
}
I get the following result:
56$gcc -o test test.c
/tmp/ccQeErYt.o: In function `main':
test.c
.text+0xe): undefined reference to `arc4random'
collect2: ld returned 1 exit status
How do I get this to work?
P.S. I have also posted this question at ubuntuforums.org (I hope it's not considered unethical for some reason to post it in two places). I've received no response there.