我想在Windows上生成exe文件, 而不需要vcruntime。链接EXE与//MT标志
所以,我想:
.cargo/config
[target.i686-pc-windows-msvc]
rustflags = ["-Clink-args=/MT"]
样子货发现配置,因为cargo
重建 整个项目,但dumpbin /DEPENDENTS test.exe
仍然显示VCRUNTIME140.dll
作为依赖, 任何想法如何链接VCRUNTIME140
静态?
我想在Windows上生成exe文件, 而不需要vcruntime。链接EXE与//MT标志
所以,我想:
.cargo/config
[target.i686-pc-windows-msvc]
rustflags = ["-Clink-args=/MT"]
样子货发现配置,因为cargo
重建 整个项目,但dumpbin /DEPENDENTS test.exe
仍然显示VCRUNTIME140.dll
作为依赖, 任何想法如何链接VCRUNTIME140
静态?
看到这个rfc
您可以rustc尝试夜间:
c:\Users\IEUser\test2>rustc -Z unstable-options -C target-feature=+crt-static test.rs
user1034749答案涉及到rustc。如果你想用货物做这件事,信息在这里:https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md
RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc