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
Hi,
I tried to get the debugging of c file in the browser using the following code.
'C' code:
int doubler(int x) {
return 2 * x;
}
compilation code:
emcc hello_world.c -g4 -s WASM=1 -s SIDE_MODULE=1 -s "EXPORTED_FUNCTIONS=['_doubler']" -o hello_world.wasm -g --source-map-base http://localhost:6931/
error:
Unknown option '--all-features'
shared:ERROR: 'D:/GitHub/emsdk/clang/e1.38.30_64bit/binaryen\bin\wasm-as hello_world.wast -o hello_world.wasm --all-features --disable-bulk-memory -g --source-map=hello_world.wasm.map --source-map-url=http://localhost:6931/hello_world.wasm.map' failed (1)
any help would be appreciated.
thanks