rust - 我的空 Rust 项目无法编译,我该怎么办?

标签 rust bevy

昨天我试图更新我的大量依赖,但一切都停止了。我从版本“0.1.2”更改为版本“0.1.3”。当我这样做时,我的项目完全停止编译。我将依赖项更改回“0.1.2”,但它没有解决问题。然后我运行了 rustup update ,但这也没有解决问题。所以,最后,我删除了所有项目代码,除了:

use bevy:: {
    prelude::*,
    input::mouse::{MouseButtonInput, MouseMotion},
};

fn main() {
  println!("Hello.");
}

我的cargo.toml也很简单,唯一修改的部分如下:

[dependencies]
bevy = "0.1.2"

所以,我得到的错误如下:

error[E0599]: no function or associated item named `perspective_rh` found for struct `glam::f32::mat4::Mat4` in the current scope
  --> src\github.com-1ecc6299db9ec823\bevy_render-0.1.3\src\camera\projection.rs:22:15
   |
22 |         Mat4::perspective_rh(self.fov, self.aspect_ratio, self.near, self.far)
   |               ^^^^^^^^^^^^^^
   |               |
   |               function or associated item not found in `glam::f32::mat4::Mat4`
   |               help: there is an associated function with a similar name: `perspective_lh`
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
           `use bevy_math::perspective::PerspectiveRh;`

我应该怎么做才能解决这个问题?

编辑(rustup 检查结果):

rustup check stable-x86_64-pc-windows-msvc - Up to date : 1.45.2 (d3fb005a3 2020-07-31) nightly-x86_64-pc-windows-msvc - Up to date : 1.47.0-nightly (f44c6e4e2 2020-08-24)

最佳答案

尝试cargo clean并删除Cargo.lock

关于rust - 我的空 Rust 项目无法编译,我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63588720/

相关文章:

rust - 从 glob-entry 获取文件路径以用于 fs::read_to_string

rust - 以不同的名称重新导出模块

rust - 为什么这个生命周期函数是可能的?

user-interface - 如何在bevy中明确描述具有绝对定位的UI元素的Z顺序?

rust - 在Bevy Engine中,如何在for-each系统中使用&mut查询?

rust - 创建自定义彩色 dbg! Rust 中的宏

rust - "covering"类型的要求到底是什么?为什么单个元素元组可以满足它?

rust - Bevy "scope"如何根据参数类型对其系统进行处理?

rust - 在Bevy游戏引擎中将1000x1000像素纹理分配给Sprite Sheet Bundle大约需要5秒

rust - 如何更改 SpriteComponent 颜色?