Rustc prefer-dynamic not executable

My versions:

Windows 11 22631.4317
rustc 1.82.0-nightly (1f12b9b0f 2024-08-27)

In main.rs:

fn main() {
    println!("1");
}

The command is:

rustc main.rs -C prefer-dynamic=y

And as running main.exe, a system error occurs about std-fa75d0dc3936bdca.dll not found, and codes cannot continue.

You need to add the directory returned by rustc --print target-libdir to your path for the dynamic linker to be able to find std.dll.