Stream: git-wasmtime

Topic: wasmtime / Issue #967 Embed rust example not working.


view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2020 at 20:45):

alexcrichton commented on Issue #967:

I believe this has since been fixed, so closing

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2020 at 20:45):

alexcrichton closed Issue #967:

When compiling trying to run the example https://github.com/bytecodealliance/wasmtime/blob/master/docs/embed-rust.md it fails with the attached error message. It seems the API has changed since the documentation was written. I am using 0.11.0. Can anyone verify this?

```$ cargo run
Compiling wasmtime_hello v0.1.0 (/Users/gustaveiman/rust_projects/wasmtime_hello)
error[E0061]: this function takes 2 parameters but 3 parameters were supplied
--> src/main.rs:10:20
|
10 | let instance = Instance::new(&store, &module, &[]).expect("wasm instance");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named find_export_by_name found for type wasmtime::instance::Instance in the current scope
--> src/main.rs:12:27
|
12 | let answer = instance.find_export_by_name("answer").expect("answer").func().expect("function");
| ^^^^^^^^^^^^^^^^^^^ method not found in wasmtime::instance::Instance

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0061, E0599.
For more information about an error, try rustc --explain E0061.
error: could not compile wasmtime_hello.

To learn more, run the command again with --verbose.```


Last updated: Nov 22 2024 at 16:03 UTC