Skip to content

docs(embed/c): add minimal call-exported-function example#311

Draft
shubham5080 wants to merge 1 commit into
WasmEdge:mainfrom
shubham5080:docs/call-exported-function
Draft

docs(embed/c): add minimal call-exported-function example#311
shubham5080 wants to merge 1 commit into
WasmEdge:mainfrom
shubham5080:docs/call-exported-function

Conversation

@shubham5080

Copy link
Copy Markdown

Summary

  • Adds docs/embed/c/call_exported_function.md: smallest C host calling an exported fib via WasmEdge_VMRunWasmFromFile
  • No WASI (module does not need it); n from CLI
  • Documents linking against ~/.local/wasmedge (include + lib64) so distro libwasmedge does not get picked up by mistake

Why in docs

Follow-up to WasmEdge/WasmEdge#5148 (closed: new examples belong in WasmEdge/docs, not WasmEdge/WasmEdge).

Related: WasmEdge/WasmEdge#2406

Test plan

  • Local build + run with WasmEdge 0.17.1
  • ./run_fib fibonacci.wasm 8fib(8) = 34
  • ./run_fib fibonacci.wasm 32fib(32) = 3524578

Show a small C host that loads fibonacci.wasm via the C API without WASI,
accepts n from argv, and documents linking against a user-local WasmEdge
install under ~/.local/wasmedge.

Signed-off-by: shubham5080 <shubhamshinde5080@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant