Build hello_world.c
using
emcc hello_world.c -Os -s WASM=1 -s SIDE_MODULE=1 -o hello_world.wasm
(make sure to use latest Emscripten incoming). That creates a
WebAssembly dynamic libraryhello_world.wasm
. You can then run
hello_world.html
in your browser, which loads and uses it.
More details: https://github.com/kripken/emscripten/wiki/WebAssembly-Standalone
I tried all proposed solutions but none of them works for me.
I don't have any issue when I write .wat files and use wat2wasm tool to generate .wasm files.
the problem happens only when I use emscripten to generate WebAssembly code.