|
|
hai 1 ano | |
|---|---|---|
| .. | ||
| src | hai 1 ano | |
| wasm-apps | %!s(int64=2) %!d(string=hai) anos | |
| .gitignore | %!s(int64=5) %!d(string=hai) anos | |
| CMakeLists.txt | %!s(int64=2) %!d(string=hai) anos | |
| README.md | %!s(int64=5) %!d(string=hai) anos | |
| build.sh | hai 1 ano | |
| run.sh | %!s(int64=5) %!d(string=hai) anos | |
This sample demonstrates a few basic usages of embedding WAMR:
Execute the build.sh script then all binaries including wasm application files would be generated in 'out' directory.
$ ./build.sh
Enter the out directory.
$ cd ./out/
$
$ ./basic -f wasm-apps/testapp.wasm
calling into WASM function: generate_float
Native finished calling wasm function generate_float(), returned a float value: 102009.921875f
calling into WASM function: float_to_string
calling into native function: intToStr
calling into native function: get_pow
calling into native function: intToStr
Native finished calling wasm function: float_to_string, returned a formatted string: 102009.921
Or execute the run.sh script in samples/basic folder.
$ ./run.sh
calling into WASM function: generate_float
Native finished calling wasm function generate_float(), returned a float value: 102009.921875f
calling into WASM function: float_to_string
calling into native function: intToStr
calling into native function: get_pow
calling into native function: intToStr
Native finished calling wasm function: float_to_string, returned a formatted string: 102009.921