webassembly-webgl-shaders
webassembly-webgl-shaders copied to clipboard
Uncaught TypeError: Module._free is not a function
Hello I compiled according to your method. Compile command: emcc -o ./dist/appWASM.js ./dev/cpp/emscripten.cpp -O3 -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s FULL_ES3=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -std=c ++1z -s EXPORTED_RUNTIME_METHODS="['ccall','stringToUTF8']" -s ASSERTIONS=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0
But when running your demo, the following error is reported:
Uncaught TypeError: Module._free is not a function
at ccallArrays (wasm-arrays.js:1:975)
at HTMLButtonElement.
May I ask what is the reason?
Thanks a lot for your reply!
But if I use the appWASM.js and appWASM.wasm files from your demo, no error will be reported.
Hey. It's possible that some things may have changed with the way things are compiled, in WebAssembly. This was (I think) quite early on, and I have moved on to other things since, so I'm unsure I'm afraid. You might need a different compile command now.
Hi DanRuta! Thank you very much for your reply. I added the -s EXPORTED_FUNCTIONS="['_free', '_main']" parameter when compiling. There are no errors when running.