Professional Web Applications Themes

Random.h - Debian

Hello! I'm trying to #include <linux/random.h> because I've read somewhere that if I need very good random numbers in linux thats the way to go. But when I include it and try to compile I get: $gcc -lgmp prim_med_gmp.c /tmp/ccgB8Uh9.o(.text+0x15b): In function `main': : odefined reference to "get_random_bytes" collect2: ld returned 1 exit status I think there is some library I should include but I have no idea which. How do I fix this? /nisse -- To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email] with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]...

  1. #1

    Default Random.h

    Hello!

    I'm trying to
    #include <linux/random.h>
    because I've read somewhere that if I need very good random numbers in
    linux thats the way to go.
    But when I include it and try to compile I get:
    $gcc -lgmp prim_med_gmp.c
    /tmp/ccgB8Uh9.o(.text+0x15b): In function `main':
    : odefined reference to "get_random_bytes"
    collect2: ld returned 1 exit status

    I think there is some library I should include but I have no idea which.
    How do I fix this?

    /nisse


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Nils-Erik Svangård Guest

  2. #2

    Default Re: Random.h

    On Mon, Jul 28, 2003 at 11:59:37AM +0200, Nils-Erik Svang?rd wrote:
    > I'm trying to
    > #include <linux/random.h>
    > because I've read somewhere that if I need very good random numbers in
    ^^^^^^^^^

    Where?
    > linux thats the way to go.
    > But when I include it and try to compile I get:
    > $gcc -lgmp prim_med_gmp.c
    > /tmp/ccgB8Uh9.o(.text+0x15b): In function `main':
    > : odefined reference to "get_random_bytes"
    > collect2: ld returned 1 exit status
    You're not supposed to include kernel headers like <linux/random.h> from
    userspace code.

    Have you tried just using the libc's rand() function? If that's too
    pseudo-random for you, you could read from /dev/random instead. See the
    random(4) man page.

    Cheers,

    --
    Colin Watson [cjwatsonflatline.org.uk]


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Colin Watson Guest

Similar Threads

  1. 'random' not really random ?
    By Somnifer in forum Macromedia Director Basics
    Replies: 3
    Last Post: May 1st, 03:11 AM
  2. how can i Random?
    By Exccelibar webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 3
    Last Post: February 1st, 02:07 PM
  3. Using Math.random to go to random frames
    By Glen Gummess webforumsuser@macromedia.com in forum Adobe Flash, Flex & Director
    Replies: 2
    Last Post: January 23rd, 10:26 PM
  4. PS7 random dpi changes 200 -> 300 HELP
    By Mac McDougald in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 3
    Last Post: July 10th, 06:09 PM
  5. Random image in a random place.
    By JoshR webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 8th, 03:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139