【发布时间】:2022-01-11 10:31:28
【问题描述】:
我正在编写一个带有 rust 的操作系统,我已经在汇编中编写了引导加载程序。
但在 rust 中,我想使用不稳定的 build-std 功能。
我知道它需要访问rust-src。我已经使用rustup 安装了它。
我运行了这个命令:
rustup component add rust-src
它给了我这个输出:
info: component 'rust-src' is up to date
但是当我尝试使用 cargo 编译代码时,它给了我这个错误:
error: "/usr/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add rust-src
我该怎么办?
【问题讨论】:
-
看起来它试图从您的包管理器中找到
rust-src而不是rustup,which cargo的输出是什么?您也可以尝试从包管理器安装rust-src:我相信sudo apt install rust-src(community.linuxmint.com/software/view/rust-src) 或卸载rust 并仅从rustup 使用:sudo apt uninstall rust。但欢迎提供有关如何安装 rust 的更多详细信息。
标签: rust rust-cargo