Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Emscripten 1.38.17+ incompatible with upstream SDL 2.0.8 #7525
I use recent upstream SDL2_* at https://play.freedink.org/ - with success so far.
Since c346176 precisely however, running the game issues:
Somehow the .js file now declares:
while it used to be:
Hmm, looks like that was removed by #6202. That replaced those methods with
@juj, was there a plan for backwards compatibility support for JS in such a case?
SDL2 calls emscripten_set_mousemove_callback from C:
With USE_SDL=2, this gets automagically replaced:
though I fail to understand where this is triggered.
With -lSDL2 we get:
and no *_on_thread function is defined.
This is still the case in 1.38.20.
referenced this issue
Jan 13, 2019
@Beuc I'm hitting this same "missing function: emscripten_set_mousemove_callback" error though in a different context, can you elaborate how it was resolved by "a complete recompilation of my dev root with all the .a libs"?
Trying to build the examples from https://github.com/tomaka/winit/ with emscripten, using emsdk 1.38.22, I had 1.37.12 installed previously but I've installed and reinstalled and activated the latest, still think I somehow have extra leftover state laying around. Is deleting ~/.emscripten_cache sufficient?
The migration from
this is to avoid adding two redundant copies of each html5 function that would increase code size, and require compiler to perform the correct inlining choice to optimize the size down.
Same result after clearing everything:
emcc --clear-cache emcc --clear-ports cargo clean
I also tried on a completely new system (a fresh virtual machine, clean OS install), cloned and installed emsdk 1.38.22, rustup with Rust stable, and winit from scratch, same "window.js:7196 missing function: emscripten_set_mousemove_callback".
If it helps, posted the window.js here: https://gist.github.com/iceiix/81accf2e1b2c62e24b8b27ca05d5398c
Aha, that could be it. I updated to Rust stable 1.32.0 released today, and sure enough it downloads the standard library compiled for wasm32-unknown-emscripten:
info: installing component 'rust-std' for 'wasm32-unknown-emscripten'
but I recompiled the example, with the same error. I'm not sure how/if I can update the emscripten for rust-std. rust-windowing/winit#760 any ideas?
(The alternative, for those who might find this issue in the future when trying to use Rust with WebAssembly, is to use the wasm32-unknown-unknown target instead, which compiles directly to wasm without emscripten.. but personally I would like to use the emscripten target if possible since it compiles my app almost untouched).
Found out the reason for the Rust winit crate incompatibility. Unfortunately, winit uses FFI to access the emscripten C API, so although C source compatibility was maintained with