[英]Unable to build bevy on windows rust
我正在尝试在 windows 上使用带有 rust 的 bevy 游戏引擎。 我的机器上安装了x86_64-mingw
。 我已将 rust 工具链默认设置为x86_64-pc-windows-gnu
。 我将bevy = "0.4.0"
放在Cargo.toml
的依赖项下。
我尝试了cargo build
,但出现以下错误
error: failed to run custom build command for `syn v1.0.63`
Caused by:
could not execute process `C:\Users\USERNAME\Projects\rust-game\target\debug\build\syn-a158346a8e8b6be7\build-script-build` (never executed)
Caused by:
Access is denied. (os error 5)
warning: build failed, waiting for other jobs to finish...
error: build failed
当我尝试在管理员模式下编译syn
编译但另一个库给出错误
Compiling proc-macro2 v1.0.24
Compiling syn v1.0.63
Compiling serde_derive v1.0.124
Compiling serde v1.0.124
error: failed to run custom build command for `proc-macro2 v1.0.24`
Caused by:
could not execute process `C:\Users\USERNAME\Projects\rust-game\target\debug\build\proc-macro2-a1d2a8cf734884f9\build-script-build` (never exe
cuted)
Caused by:
Access is denied. (os error 5)
warning: build failed, waiting for other jobs to finish...
error: build failed
编辑:我的防病毒软件正在阻止它,并拒绝它访问,所以只是转动我的 AV 一段时间就可以了!
我尝试编译一个使用bevy = "0.4.0"
并且能够使用stable-x86_64-pc-windows-msvc
工具链但不能使用stable-x86_64-pc-windows-gnu
构建的项目。
就我而言, bevy-glsl-to-spirv
是未能构建的板条箱。 在bevy 书中指定您必须安装 VS build tools 2019。 他们没有明确说您必须使用msvc
工具链,但由于他们要求您安装 VS 构建工具 2019,我猜您必须使用stable-x86_64-pc-windows-msvc
编译代码。
您可以在此处下载 VS 构建工具 2019。
还要确保安装stable-x86_64-pc-windows-msvc
工具链:
rustup toolchain install stable-x86_64-pc-windows-msvc
将此工具链设置为默认工具链。
rustup default stable-x86_64-pc-windows-msvc
最后,确保工具链已安装并设置为默认工具链:
rustup toolchain list
你应该看到:
stable-x86_64-pc-windows-gnu
stable-x86_64-pc-windows-msvc (default)
尝试进行cargo build
,它应该像魅力一样工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.