简体   繁体   English

针对较旧的 Windows 版本 (Windows Server 2008 R2)

[英]Targeting older Windows versions (Windows Server 2008 R2)

I have an older Windows 10 workstation with Rust 1.37 ( stable-x86_64-pc-windows-msvc ) and Visual Studio 2017 with the following features:我有一个较旧的 Windows 10 工作站,带有 Rust 1.37 ( stable-x86_64-pc-windows-msvc ) 和具有以下功能的 Visual Studio 2017:

  • Visual C++ Build Tools core features Visual C++ 构建工具核心功能
  • VC++ 2017 version 15.9 v14.16 latest v141 tools VC++ 2017 版本 15.9 v14.16 最新 v141 工具
  • Visual C++ 2017 Redistributable Update视觉 C++ 2017 可再发行更新
  • Windows 10 SDK (10.0.17763.0) Windows 10 SDK (10.0.17763.0)
  • Visual C++ tools for CMake适用于 CMake 的 Visual C++ 工具
  • Testing tools core features - Build Tools测试工具核心功能——构建工具

On this workstation, I can compile a program that runs fine on my target environment (Windows Server 2008 R2).在这个工作站上,我可以编译一个在我的目标环境(Windows Server 2008 R2)上运行良好的程序。

I have a newer Windows 10 workstation on which I installed the legacy version of Visual Studio 2017. Interestingly, the installer doesn't offer the exact same options for C++ build tools, but I think I have the necessary ones, eg:我有一个较新的 Windows 10 工作站,我在其上安装了旧版 Visual Studio 2017。有趣的是,安装程序没有为 C++ 构建工具提供完全相同的选项,但我认为我有必要的选项,例如:

  • VC++ 2017 version 15.9 v14.16 latest v141 tools VC++ 2017 版本 15.9 v14.16 最新 v141 工具
  • Visual C++ tools for CMake and Linux用于 CMake 和 Linux 的 Visual C++ 工具
  • Windows 10 SDK (10.0.17763.0) Windows 10 SDK (10.0.17763.0)

However, when I compile the program (with the same Rust version/toolchain) on this computer, it errors out on my target environment with "The program can't start because VCRUNTIME140.dll is missing from your computer".但是,当我在这台计算机上编译程序(具有相同的 Rust 版本/工具链)时,它在我的目标环境中出错,并显示“程序无法启动,因为您的计算机缺少 VCRUNTIME140.dll”。

What am I missing here?我在这里想念什么? How can I setup rustup/cargo to target my specific environment?如何设置 rustup/cargo 以针对我的特定环境?

I think It's because of not choosing some components when you install the vs. by the way, vs 2015 is not a good choice.我想是因为在安装vs的时候没有选择一些组件,顺便说一下vs 2015不是一个好的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM