You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error log will be very confusing if someone forgets to add the target before building for the first time.
root@TW59:~/wasm-learning/cli/hello# cargo build --target wasm32-wasi
Compiling hello v0.1.0 (/root/wasm-learning/cli/hello)
error[E0463]: can't find crate for `std`
|
= note: the `wasm32-wasi` target may not be installed
= help: consider downloading the target with `rustup target add wasm32-wasi`
error[E0463]: can't find crate for `std`
--> src/main.rs:1:5
|
1 | use std::env;
| ^^^ can't find crate
|
= note: the `wasm32-wasi` target may not be installed
= help: consider downloading the target with `rustup target add wasm32-wasi`
error: cannot find macro `println` in this scope
--> src/main.rs:6:5
|
6 | println!("{}", argument);
| ^^^^^^^
error: cannot find macro `println` in this scope
--> src/main.rs:4:3
|
4 | println!("hello");
| ^^^^^^^
error[E0433]: failed to resolve: use of undeclared crate or module `env`
--> src/main.rs:5:19
|
5 | for argument in env::args().skip(1) {
| ^^^ use of undeclared crate or module `env`
error: requires `sized` lang_item
Some errors have detailed explanations: E0433, E0463.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `hello` due to 6 previous errors
Reference:
WASI-tutorial.md this file gives an shell example with add target.
The text was updated successfully, but these errors were encountered:
The
hello
file does not mentionrustup target add wasm32-wasi
before building as a beginner example. I believe it is better for newcomers.wasm-learning/cli/hello/README.md
Lines 11 to 16 in 191de35
The error log will be very confusing if someone forgets to add the target before building for the first time.
Reference:
WASI-tutorial.md this file gives an shell example with
add target
.The text was updated successfully, but these errors were encountered: