You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows link error with std.random.uniform() in v2.111 #10731
I having link errors now in code that previously working fine, the error is as follows
Error: undefined reference to `BCryptGenRandom`
referenced from `nothrow @nogc @trusted bool std.random.bcryptGenRandom!(ulong).bcryptGenRandom(out ulong)`
perhaps a library needs to be added with the `-L` flag or `pragma(lib, ...)`
It works if I link bcrypt.lib manually (using dub libs section).
Looking at the source code for std.random reveals that there is pragma(lib, "Bcrypt.lib"); but for some reason it doesn't works.
Activity
0xEAB commentedon Apr 4, 2025
Do we want to link Phobos against
bcrypt?Or do we load it and potentially risk another #10629?
Fix dlang#10731 - Windows link error with std.random.uniform() in v2.111
Fix dlang#10731 - Windows link error with std.random.uniform() in v2.111
Fix dlang#10731 - Windows link error with std.random.uniform() in v2.111
Fix dlang#10731 - Windows link error with std.random.uniform() in v2.111
Fix #10731 - Windows link error with std.random.uniform() in v2.111 (#…
0xEAB commentedon Apr 4, 2025
Thanks for the report :)
This has been fixed on ~stable, it’s therefore scheduled for v2.111.1.
Fix dlang#10731 - Windows link error with std.random.uniform() in v2.…