alexcrichton commented on issue #2401:
I'm going to close this since this is a pretty old issue and I believe the problems here were build-related. If there are still issues I can try to help out here or feel free to reach out on Zulip as well.
alexcrichton closed issue #2401:
I followed this official wasmtime tutorial on embedding wasmtime in C. https://github.com/bytecodealliance/wasmtime/blob/main/examples/hello.c
It provides commands to compile the C code with hello-world wasm embedded, but I don't know what do the two lines (cargo build --release -p wasmtime-c-api, target/release/libwasmtime.a) do? cargo build is for building a rust application, what has it to do with compiling C code, let alone there is no cargo.toml, so the cargo build itself would also fail. And this static library target/release/libwasmtime.a is also not in the wasmtime repo. https://github.com/bytecodealliance/wasmtime
cargo build --release -p wasmtime-c-api
cc examples/hello.c \
-I crates/c-api/include \
-I crates/c-api/wasm-c-api/include \### target/release/libwasmtime.a \
-lpthread -ldl -lm \
-o hello
./helloWithout question, I cannot get this hello-world wasm in C compiled and run :(
Thank you so much!
Last updated: Dec 23 2024 at 13:07 UTC