emscripten-core / emscripten-core/emscripten

ReferenceError: _setThrew is not defined when linking as C++

Open
#22,227 28 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**Version of emscripten/emsdk:**
emscripten/emsdk:3.1.56 (a little behind I know, but I couldn't see any recent changes that looked relevant. I will try updating soon.)

I think this is a follow up to #21381. I have no compilation errors, but despite the `invoke_` functions depending on `_setThrew`, it isn't defined.

```
function invoke_vi(index, a1) {
var sp = stackSave();
try {
dynCall_vi(index, a1);
} catch (e) {
stackRestore(sp);
if (e !== e + 0) throw e;
_setThrew(1, 0);
}
}
```

I suspect this may be happening because I've set `set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CXX)` in CMake, but there are no actual C++ files being linked in? (We previously determined that my project needs to be linked as CXX because it's using Rust.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.