小编yes*_*ler的帖子

错误[E0412]:在此范围内找不到类型“ProgramResult”

use anchor_lang::prelude::*;

declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");

#[program]
pub mod myepicproject {
  use super::*;
  pub fn start_stuff_off(ctx: Context<StartStuffOff>) -> ProgramResult {
    Ok(())
  }
}

#[derive(Accounts)]
pub struct StartStuffOff {}
Run Code Online (Sandbox Code Playgroud)

我有上面的源 Rust 代码和下面的错误。

error[E0412]: cannot find type `ProgramResult` in this scope
 --> programs/myepicproject/src/lib.rs:8:58
  |
8 |   pub fn start_stuff_off(ctx: Context<StartStuffOff>) -> ProgramResult {
  |                                                          ^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0412`.
error: could not compile `myepicproject` due to previous error
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?

使用锚点

rust blockchain smartcontracts solana anchor-solana

4
推荐指数
2
解决办法
5448
查看次数

标签 统计

anchor-solana ×1

blockchain ×1

rust ×1

smartcontracts ×1

solana ×1