Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Module._free is not a function #7

Open
Dragon-S opened this issue May 28, 2022 · 3 comments
Open

Uncaught TypeError: Module._free is not a function #7

Dragon-S opened this issue May 28, 2022 · 3 comments

Comments

@Dragon-S
Copy link

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. ((index):64:13)

May I ask what is the reason?

Thanks a lot for your reply!
截屏2022-05-28 下午6 28 05

@Dragon-S
Copy link
Author

But if I use the appWASM.js and appWASM.wasm files from your demo, no error will be reported.

@DanRuta
Copy link
Owner

DanRuta commented Jun 6, 2022

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.

@Dragon-S
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants