Becavalier / Book-DISO-WebAssembly

A book related repository which name is 《深入浅出 WebAssembly》
MIT License
72 stars 17 forks source link

run WebAssembly Standalone type report TypeError #9

Open wqtian opened 5 years ago

wqtian commented 5 years ago

参照书中第5章5.2.1,构建Standalone类型的 wasm,在火狐和google浏览器中运行生成的html文件,报 TypeError: exportFuncAdd is not a function。

但是直接使用你在git上提供的 html 和 wasm,却能正常运行。书中的编译命令 emcc emscripten-standalone.cc -Os -s WASM=1 -o emscripten-standalone.js ,不知道是不是emcc 版本问题,还是编译方式需要调整?

我的emcc 版本为 emcc (Emscripten gcc/clang-like replacement) 1.38.31 (commit 55ad1c4502293cc0f6ce8d5a249c941eee604269)

Becavalier commented 5 years ago

@wqtian Hi, I have got your issue, the solution will be published here asap. Thanks!