Skip to content

urandom(16) not working on Windows? #30

@pietroppeter

Description

@pietroppeter

using nim 1.4 on Windows and nim-random 0.5.7, the following file:

import random/urandom

echo urandom(16)

gives the following error:

C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected]: In function 'urandomInit__I9c059c8UXWLwo8XePhclOUw':
C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected]:423:84: error: 'PROV_RSA_FULL' undeclared (first use in this function); did you mean 'ERROR_DISK_FULL'?     
  success = Dl_12296201_((&cryptProv__QYmaJrNrOSePQ9c9bh9bYJIDA), NIM_NIL, NIM_NIL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
                                                                                    ^~~~~~~~~~~~~
                                                                                    ERROR_DISK_FULL
C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected]:423:84: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected]:423:99: error: 'CRYPT_VERIFYCONTEXT' undeclared (first use in this function); did you mean 'RPC_E_NO_CONTEXT'?
  success = Dl_12296201_((&cryptProv__QYmaJrNrOSePQ9c9bh9bYJIDA), NIM_NIL, NIM_NIL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
                                                                                                   ^~~~~~~~~~~~~~~~~~~
                                                                                                   RPC_E_NO_CONTEXT

Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN   -IC:\Users\ppeterlongo\scoop\apps\nim\current\lib -IC:\Users\ppeterlongo\nimib -o C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected] C:\Users\ppeterlongo\nimcache\x_urandom_d\@[email protected]@[email protected]@[email protected]' failed with exit code: 1```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions