diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs index 95da470f7..a9304971d 100644 --- a/lib/cli/src/commands/create_exe.rs +++ b/lib/cli/src/commands/create_exe.rs @@ -279,9 +279,13 @@ impl LinkCode { command }; // Add libraries required per platform. - // We need userenv, sockets (Ws2_32), and advapi32 to call a system call (for random numbers I think). + // We need userenv, sockets (Ws2_32), advapi32 for some system calls and bcrypt for random numbers. #[cfg(windows)] - let command = command.arg("-luserenv").arg("-lWs2_32").arg("-ladvapi32"); + let command = command + .arg("-luserenv") + .arg("-lWs2_32") + .arg("advapi32") + .arg("-lbcrypt"); // On unix we need dlopen-related symbols, libmath for a few things, and pthreads. #[cfg(not(windows))] let command = command.arg("-ldl").arg("-lm").arg("-pthread"); diff --git a/tests/integration/cli/src/link_code.rs b/tests/integration/cli/src/link_code.rs index 3dce23635..0346dbc7d 100644 --- a/tests/integration/cli/src/link_code.rs +++ b/tests/integration/cli/src/link_code.rs @@ -50,7 +50,11 @@ impl LinkCode { ) .arg(&self.libwasmer_path.canonicalize()?); #[cfg(windows)] - let command = command.arg("-luserenv").arg("-lWs2_32").arg("-ladvapi32"); + let command = command + .arg("-luserenv") + .arg("-lWs2_32") + .arg("-ladvapi32") + .arg("-lbcrypt"); #[cfg(not(windows))] let command = command.arg("-ldl").arg("-lm").arg("-pthread"); let output = command.arg("-o").arg(&self.output_path).output()?;