< 返回版块

hjs99 发表于 2021-07-26 13:36

按照writing-an-os-in-rust写一个os,进行到最小化内核,用cargo bootimage创建一个可引导的磁盘映像。 出现编译错误 PS D:\rustdata\blog_os> cargo bootimage Building kernel WARNING: You're currently building for the host system. This is likely an error and will cause build scripts of dependencies to break.

To build for the target system either pass a --target argument or set the build.target configuration key in a .cargo/config file.

Compiling semver v1.0.3 Compiling bitflags v1.2.1 Compiling llvm-tools v0.1.1 Compiling zero v0.1.2 error[E0463]: can't find crate for std

For more information about this error, try rustc --explain E0463. error: could not compile bitflags due to previous error warning: build failed, waiting for other jobs to finish... error: build failed Error: Kernel build failed

评论区

写评论
songzhi 2021-07-26 19:53

既然写内核肯定要#[no_std],所以不是你写的代码没加就是依赖没指定feature。

1 共 1 条评论, 1 页