Example 1: Export C Functions to WASM
The related code/working directory of this example resides in directory {WAMR_DIR}/samples/basic
The "basic" sample project
This sample demonstrates a few basic usages of embedding WAMR:
initialize runtime
load wasm app and instantiate the module
call wasm function and pass arguments
export native functions to the WASM apps
wasm function calls native function and pass arguments
deinitialize runtime
Build this sample
Execute the build.sh
script then all binaries including wasm application files would be generated in 'out' directory.
Run the sample
Enter the out directory.
Or execute the run.sh
script in samples/basic
folder.
Last updated