Re: Assertion failed: cannot call main when async dependencies remain! (listen on __ATMAIN__)

2018-02-14 Thread Giovanni Parra
How can I know if it is ok to call main? Is there something my JS code can listen to that will notify me that I can call main? Or should I just call main repeatedly until it works? On Wednesday, July 30, 2014 at 7:03:44 PM UTC-3, Alon Zakai wrote: > > You should only call main() when things are

Error using emscripten fetch API

2018-02-14 Thread Stéphane Letz
I'm trying to replace old code with the emscripten fetch API, using the example code given here: https://kripken.github.io/emscripten-site/docs/api_reference/fetch.html following the "Synchronous Fetches" section. Our library is then linked with --proxy-to-worker flag. At run time, I get an

Re: Assertion failed: cannot call main when async dependencies remain! (listen on __ATMAIN__)

2018-02-14 Thread Alon Zakai
Yes, you can listen on onRuntimeInitialized for example, see https://kripken.github.io/emscripten-site/docs/getting_started/FAQ.html#how-can-i-tell-when-the-page-is-fully-loaded-and-it-is-safe-to-call-compiled-functions On Wed, Feb 14, 2018 at 6:13 AM, Giovanni Parra wrote:

Re: Error using emscripten fetch API

2018-02-14 Thread Stéphane Letz
OK, I found out -s FETCH=1 described in settings.js, but now I get a link error: emcc -O3 -–proxy-to-worker --memory-init-file 0 -s WASM=1 -s FETCH=1 -s EXPORT_NAME="'FaustModule'" -s MODULARIZE=1 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=1 -s