链接exe与// MT标志

时间:2017-02-23 16:04:41

标签: windows linker rust rust-cargo

我想在windows上构建exe文件, 不需要vcruntime。

所以我试过了:

<h1>float layout</h1>
<div class="float">
  <div class="col-1-10 a">float float float float float float , I can grow </div>
  <div class="col-9-10 b">...</div>
</div>
<div class="float small">
  <div class="col-1-10 a">...</div>
  <div class="col-9-10 b">block block block block block block, I can shrink</div>
</div>

<h1>table layout</h1>
<div class="table">
  <div class="col-1-10 a">table-cell, I cannot grow unless content pieces are wider than the initial 85px (img, long word, .. ) </div>
  <div class="col-9-10 b">...</div>
</div>
<div class="table small">
  <div class="col-1-10 a"></div>
  <div class="col-9-10 b">table-cell table-cell table-cell, table-cell , I can shrink</div>
</div>

<hr/>
<hr/>
<h1>Flex layout</h1>
<div class="flex">
  <div class="col-1-10 a">flex flex flex flex flex , I can grow </div>
  <div class="col-9-10 b">...</div>
</div>
<div class="flex small">
  <div class="col-1-10 a"></div>
  <div class="col-9-10 b">flex flex flex flex flex , I can shrink</div>
</div>
<hr/>

<h1>grid layout</h1>
<div class="grid">
  <div class="col-1-10 a">grid cell , i can have a min and width or I can grow </div>
  <div class="col-9-10 b">...</div>
</div>
<div class="grid bis">
  <div class="col-1-10 a">grid cell , i can have a min and or share the pace with others </div>
  <div class="col-9-10 b">...</div>
</div>
<div class="grid small">
  <div class="col-1-10 a">...</div>
  <div class="col-9-10 b">grid cell , I can shrink</div>
</div>
由于.cargo/config [target.i686-pc-windows-msvc] rustflags = ["-Clink-args=/MT"] 重建,

看起来像货物找到配置 整个项目,但cargo 仍显示dumpbin /DEPENDENTS test.exe作为依赖项, 任何想法如何静态链接VCRUNTIME140.dll

2 个答案:

答案 0 :(得分:1)

请参阅此rfc

你可以每晚用rustc尝试一下:

c:\Users\IEUser\test2>rustc -Z unstable-options -C target-feature=+crt-static test.rs

答案 1 :(得分:0)

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