我正在 powershell 中为我的 Rust 项目运行这个:
cargo build --target thumbv7em-none-eabihf
在我尝试执行此命令后,它会产生此错误:
error: failed to parse manifest at C:\Users\PC\Downloads\Blizzard\Cargo.toml Caused by: virtual manifests must be configured with [workspace]
这是我的 Cargo.toml 文件:
[package]
name = "my-project"
version = "0.1.0"
authors = ["runner"]
edition = "2021"
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
如果需要,这是我的 Rust 文件:
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[no_mangle]
pub extern "C" fn _start() -> ! {
loop {}
}
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
我的文件路径如下所示:
> Blizzard
> src
> main.rs
> Cargo.toml
如何解决这个问题?任何帮助表示赞赏
在您的cargo.toml中添加以下内容
[workspace] members = ["NameOfYourPackage"]