learn-webassembly icon indicating copy to clipboard operation
learn-webassembly copied to clipboard

Need update for emscripten latest(1.38.0 above)

Open EugeneChung opened this issue 6 years ago • 0 comments

As #1 indicated, the examples of the master branch are not working with the emscripten 1.38.0 above. (For me, 1.38.30)

I made them work like below;

  1. Modify common/load-wasm.js as https://github.com/emscripten-core/emscripten/pull/7467 said.
  2. Specify emcc EXPORTED_FUNCTIONS option https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#calling-compiled-c-functions-from-javascript-using-ccall-cwrap For chapter-05-create-load-module as instance, emcc .\without-glue.c -Os -s WASM=1 -s SIDE_MODULE=1 -s BINARYEN_ASYNC_COMPILATION=0 -s EXPORTED_FUNCTIONS='["_init", "_setIsRunning", "_getIsRunning", "_updateRectLocation", "_moveRect"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -o without-glue.wasm

EugeneChung avatar Apr 14 '19 12:04 EugeneChung