https://zenn.dev/link/comments/24fa31008e9a2e をもとにコードを書いてみたのがずっと
error[E0432]: unresolved import `eframe` --> src\main.rs:1:5 | 1 | use eframe::{egui, epi}; | ^^^^^^ maybe a missing crate `eframe`? For more information about this error, try `rustc --explain E0432`. error: could not compile `soft_name` due to previous error
というエラーが出てきて cargo run が動きません
環境
Windows 10 21H2
rustc 1.60.0
cargo 1.60.0
choco を利用してインストール
Cargo.toml
1[package] 2name = "soft_name" 3version = "0.1.0" 4 5# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 6 7[dependencies] 8eframe = "0.18.0"
src/main.rs
1use eframe::{egui, epi}; 2 3#[derive(Default)] 4pub struct SimpleApp {} 5 6impl epi::App for SimpleApp { 7 fn name(&self) -> &str { 8 "SimpleApp" 9 } 10 11 fn update(&mut self, ctx: &egui::CtxRef, _frame: &mut epi::Frame<'_>) { 12 ctx.set_pixels_per_point(1.5); 13 egui::CentralPanel::default().show(ctx, |ui| { 14 ui.label("Hello World!!"); 15 }); 16 } 17} 18 19fn main() { 20 let app = SimpleApp::default(); 21 eframe::run_native(Box::new(app)); 22}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/06/01 10:49