Skip to content
Discussion options

You must be logged in to vote

Exception catching is off by default, and the flag has to be present at compile and link time.
The second half is what usually bites: the build compiles fine, then links without exception
support.

Two options.

-fexceptions — Emscripten's JavaScript-based implementation. Works on every engine with Wasm
support, noticeable size and speed cost. -sDISABLE_EXCEPTION_CATCHING=0 is the older spelling of
the same thing.

-fwasm-exceptions — native WebAssembly exception handling. Smaller and faster, not implemented by
every engine yet; current major browsers have it.

Pass it to both phases:

emcc -fwasm-exceptions -c image.cpp -o image.o
emcc -fwasm-exceptions image.o -o app.js

In CMake that means t…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@sbc100
Comment options

@AllMeatball
Comment options

Comment options

You must be logged in to vote
1 reply
@AllMeatball
Comment options

Answer selected by AllMeatball
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants