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 检查 stable-x86_64-pc-windows-msvc - 最新:1.45.2 (d3fb005a3 2020-07-31) nightly-x86_64-pc-windows-msvc - 最新:1.47.0-nightly (f44c6e4e2 2020- 08-24)
解决方案
尝试cargo clean
并删除Cargo.lock
.
推荐阅读
- wordpress - 在woocommerce中价格= 0时如何隐藏“添加到购物车”
- php - htaccess 重写 url 获取
- python - OpenCV:与预定义约束匹配的描述符
- nestjs - 在 NestJS 中测试 Passport
- amazon-web-services - 如何在 QuickSight 控件中选择今天的日期作为默认日期?
- akeneo - 恢复数据库问题
- excel - 类型不匹配 W/长数据类型
- scikit-learn - 使用mutual_info_classif 提取最重要的特征(每类)
- python - 将大表的一部分读取到 AWS GLUE 的最佳方式
- php - 带有空查询的 PHP if 语句