Open mm318 opened 5 months ago
Managed to workaround this by adding to the source file:
#include <stdexcept>
#include <typeinfo>
int main() {
throw std::runtime_error("HELLO WORLD!!");
return 0;
}
extern "C" {
void * __cxa_allocate_exception(size_t /*thrown_size*/) { abort(); }
void __cxa_throw(void */*thrown_object*/, std::type_info */*tinfo*/, void (*/*dest*/)(void *)) { abort(); }
}
Though not sure if this should be the user experience (haven't tried emscripten).
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
Using the following source file
hello.cpp
:Try to compile it with
zig build-exe -target wasm32-wasi -lc++ hello.cpp
and get the following error:Expected Behavior
The compilation would succeed and a
hello.wasm
file is produced.