rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.59k stars 12.74k forks source link

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 #111576

Closed Satyam1Vishwakarma closed 2 weeks ago

Satyam1Vishwakarma commented 1 year ago

While compiling reqwest library in windows 11

= note: ld: cannot find -lntdll: No such file or directory

ChrisDenton commented 1 year ago

Can you give any more information? What toolchain are you using? The output of rustc --version --verbose would be very useful.

Also, have you customized the toolchain in some way? E.g. with a .cargo/config.toml file?

ZahiriNatZuke commented 1 year ago

i have the same problem, this is the output of rustc --version --verbose in my case

rustc 1.69.0 (84c898d65 2023-04-16) binary: rustc commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc commit-date: 2023-04-16 host: x86_64-pc-windows-gnu release: 1.69.0 LLVM version: 15.0.7

ChrisDenton commented 1 year ago

Could you show some code I can try? Rust 1.69 will not set -lntdll itself.

zhtk commented 1 year ago

I have the same rustc version as above. In my case it seems to be caused by dependency to mio = { version = "0.8.6", features = ["os-poll", "net"] }. Under the hood it uses ntapi which links this library: https://github.com/MSxDOS/ntapi/blob/master/build.rs#L9.