Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urandom(16) not working on Windows? #30

Open
pietroppeter opened this issue Apr 14, 2021 · 0 comments
Open

urandom(16) not working on Windows? #30

pietroppeter opened this issue Apr 14, 2021 · 0 comments

Comments

@pietroppeter
Copy link

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\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c: In function 'urandomInit__I9c059c8UXWLwo8XePhclOUw':
C:\Users\ppeterlongo\nimcache\x_urandom_d\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c: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\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c:423:84: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\ppeterlongo\nimcache\x_urandom_d\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c: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\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c.o C:\Users\ppeterlongo\nimcache\x_urandom_d\@m..@s.nimble@spkgs@srandom-0.5.7@srandom@surandom.nim.c' failed with exit code: 1```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant