Skip to content

Commit 4799266

Browse files
CharryWuLegNeato
authored andcommitted
fix(vecadd): link advapi32 for windows nanorand
Made-with: Cursor
1 parent e81a32b commit 4799266

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

examples/vecadd/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ use std::path;
44
use cuda_builder::CudaBuilder;
55

66
fn main() {
7+
// On Windows, nanorand's entropy uses SystemFunction036 (RtlGenRandom) from advapi32.
8+
// Explicitly link it so the MSVC linker resolves the symbol (avoids LNK2019 when
9+
// mixing CRTs or with certain link orders).
10+
#[cfg(target_os = "windows")]
11+
println!("cargo:rustc-link-lib=advapi32");
12+
713
println!("cargo::rerun-if-changed=build.rs");
814
println!("cargo::rerun-if-changed=kernels");
915

0 commit comments

Comments
 (0)