Hi, Im compiling rust to wasm. When I run the command rustc --target=wasm32-unknown-unknown hello.rs -o hello.html getting following error.
I already run the command rustup target add wasm32-unknown-unknown
info: component ‘rust-std’ for target ‘wasm32-unknown-unknown’ is up to date
error[E0463]: can't find crate for `wasmi`
--> hello.rs:1:1
|
1 | extern crate wasmi;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
Building is fine using cargo build --target wasm32-unknown-unknown But I wanted to run the code in server (Rust to WebAssembly).
When I run the command cargo web start --target wasm32-unknown-unknown I’m getting blank page with the message Finished loading Rust wasm module tests.js
So I tried with rustc --target=wasm32-unknown-unknown hello.rs -o hello.html
rustc is no more able to understand Cargo’s manifest than gcc is able to understand CMake build scripts.
Also, when describing a problem, describe what you’re trying to do, not just how you’re trying to do it. Someone who might know what your problem is and read this thread before your second reply could very well have already moved on.
If you’re having trouble getting wasm code to work, you should write up a minimal reproduction, and describe exactly what you’re doing, what you expect, and what you get. You might also want to start a new thread with a more appropriate title (unless you can rename posts; not sure if you can).