windows - 使用 mingw_64 在 Windows 上编译 Rust 时无法加载代码生成后端

标签 windows rust

我正在使用 mingw_64 和 GCC 在 Windows 上编译 Rust。我收到以下错误:

error: couldn't load codegen backend "E:\rust_git\rust\build\x86_64-pc-windows-gnu\stage1\lib\rustlib\x86_64-pc-windows-gnu\codegen-backends\rustc_codegen_llvm-llvm.dll": "The specified procedure could not be found. (os error 127)"

不同于How do I fix the error "couldn't load codegen backend" on macOS? ,文件 rustc_codegen_llvm-llvm.dll 确实位于正确的目录中。

最佳答案

找到原因了,最新的mingw gcc 9.1.0 导致一些dll丢失的问题。 (虽然,编译 rust 源代码很好)。

如果你有旧版本的 msys2,这对你有用:

pacman -R  mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
pacman -R  mingw-w64-x86_64-gcc-libs  

pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libs-8.3.0-2-any.pkg.tar.xz
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-8.3.0-2-any.pkg.tar.xz
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-cmake-3.14.4-1-any.pkg.tar.xz

./x.py install
rustc -vV
rustc 1.37.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-gnu
release: 1.37.0-dev
LLVM version: 8.0

关于windows - 使用 mingw_64 在 Windows 上编译 Rust 时无法加载代码生成后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56473344/

相关文章:

PHP:等效服务器上的 SQL 语法错误

macos - 错误 : linking with `cc` failed: exit status: 1 when building rust program on macos

rust - 如何将整个 crate 传递给程序宏?

multithreading - 在异步 block 中使用线程不安全值

windows - Tortoisehg 在使用 subrepos 时打开控制台窗口。我该如何阻止它?

mysql - 无法使用 mysqlserverclone 实用程序克隆现有的 mysql 服务器

windows - 尝试使用 PowerShell 2.0 将 regfile 复制到另一个文件夹

java - 程序编译但不会在命令框中运行

rust - 打印 Arc 和 Mutex 类型

rust - 具有不同参数的特征的 new() 方法