2021-07-16

lab1报错集锦

root@b347e8e9e0d1:/lab0/os# cargo build
    Updating git repository `https://github.com/rcore-os/riscv`
error: failed to get `riscv` as a dependency of package `os v0.1.0 (/lab0/os)`

Caused by:
  failed to load source for dependency `riscv`

Caused by:
  Unable to update https://github.com/rcore-os/riscv

Caused by:
  failed to fetch into: /root/.cargo/git/db/riscv-ab2abd16c438337b
  If your environment requires git authentication or proxying, try enabling `git-fetch-with-cli`
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  SSL error: received early EOF; class=Ssl (16); code=Eof (-20)

因为挂了vpn,似乎连不上GitHub?(雾
断掉后,报错消失

error[E0412]: cannot find type `Scause` in this scope
  --> src/interrupt/handler.rs:25:56
   |
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
   |                                                        ^^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  | use crate::interrupt::context::Scause;
   |
1  | use riscv::register::scause::Scause;
   |

warning: unused import: `scause::Scause`
 --> src/interrupt/context.rs:1:41
  |
1 | use riscv::register::{sstatus::Sstatus, scause::Scause};
  |                                         ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0412`.
error: could not compile `os`.

To learn more, run the command again with --verbose.
Makefile:20: recipe for target 'kernel' failed
make: *** [kernel] Error 101

参考云微的解决办法加入“use riscv::register::scause::Scause;”后继续报错

root@b347e8e9e0d1:/lab0/os# cargo build
   Compiling os v0.1.0 (/lab0/os)
warning: unused import: `scause::Scause`
 --> src/interrupt/context.rs:1:41
  |
1 | use riscv::register::{sstatus::Sstatus, scause::Scause};
  |                                         ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `context`
  --> src/interrupt/handler.rs:25:25
   |
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
   |                         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `stval`
  --> src/interrupt/handler.rs:25:64
   |
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
   |                                                                ^^^^^ help: if this is intentional, prefix it with an underscore: `_stval`

error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "...
          >>> referenced by 9acqm0oomv27yz6
          >>>               /lab0/os/target/riscv64imac-unknown-none-elf/debug/deps/os-93c809aeb6888d3a.9acqm0oomv27yz6.rcgu.o:(.text.entry+0x8)
          

error: aborting due to previous error; 3 warnings emitted

error: could not compile `os`.

To learn more, run the command again with --verbose.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值