gurry
1
Hi guys,
I'm trying to create an executable in rust and want it to be linked statically to the CRT. I've tried putting the following in the Cargo.toml:
[target.x86_64-pc-windows-msvc]
rustflags = ["-C target-feature=+crt-static"]
but when I run cargo build
it throws the following warning:
warning: unused manifest key: target.x86_64-pc-windows-msvc.rustflags
What am I doing wrong?
Note:I'm using the latest nightly.
Don't put it in your Cargo.toml
, instead put it in your .cargo\config
.
[target.x86_64-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static", "-Zunstable-options"]
4 Likes
gurry
3
Thanks retep998 . Should have read the cargo documentation properly.
Can I enable statically linkage to MSVC CRT only for release build?
kkocdko
5
I also want this feature, but it seems that I haven't found a way yet...