“货物构建"失败,并出现链接错误"link.exe失败:退出代码:325595"; [英] `cargo build` fails with linking error "link.exe failed: exit code: 325595"

查看:466
本文介绍了“货物构建"失败,并出现链接错误"link.exe失败:退出代码:325595";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Rust项目,可以在Linux,macOS和Windows 10上编译.

I have a Rust project that compiles okay on Linux, macOS, and Windows 10.

我今天使用 Visual Studio安装程序:

  • VC++ 2015.3 v14.00 (v140) toolset for desktop
    • Windows Universal CRT SDK(依赖项)
    • Windows 8.1 SDK(依赖项)
    • VC++ 2015.3 v14.00 (v140) toolset for desktop
      • Windows Universal CRT SDK (Dependency)
      • Windows 8.1 SDK (Dependency)

      此后,我使用官方的网站.

      当我在Windows 7计算机上的Rust项目上运行cargo build时,它失败并显示以下消息:

      When I run cargo build on my Rust project on the Windows 7 computer, it fails with the following message:

      error: linking with `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe\` failed: exit code: 325595.
      


      在Windows 10计算机上不带任何参数单独运行C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe会产生一些帮助"信息,但是在Windows 7计算机上,我看到一个带有错误消息的窗口:


      Running C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe all on its own with no arguments on my Windows 10 computer produces some "help" information, but on my Windows 7 computer, I get a window with the error message:

      The application was unable to start correctly (0xc000007b).  Click Ok to close the application.
      


      我的Google-Fu尚未显示任何有用的信息.我尝试过:


      My Google-Fu hasn't turned up any useful information. I've tried:

      • sfc /scannow
      • 确保System32没有32位DLL
      • 确保SysWOW64没有64位DLL

      推荐答案

      下载最新的64位运行时可用于Visual Studio 2017的Visual C ++ Redistributable link.exe可在我的Windows 7计算机上使用.我现在可以编译我的Rust项目.

      After downloading the latest 64-bit runtime Visual C++ Redistributable for Visual Studio 2017, link.exe works on my Windows 7 computer. I can now compile my Rust project.

      对于Visual Studio Installer不能确保为2015年的工具集安装必要的运行时组件,我感到很惊讶.

      I'm surprised that the Visual Studio Installer doesn't ensure that the necessary runtime components are installed for the 2015 toolset.

      更新: Stargateur 指出可以从Visual Studio直接安装可再发行组件安装程序. 它是Visual C++ 2017 Redistributable Update单个组件.

      Update: Stargateur pointed out that the Redistributable can be installed directly from the Visual Studio Installer. It is the Visual C++ 2017 Redistributable Update individual component.

      这篇关于“货物构建"失败,并出现链接错误"link.exe失败:退出代码:325595";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆