Calling C++ function from JavaScript through Qt Webassembly
-
Re: Calling C++ function from JavaScript through Webassembly
Same issue.
extern "C" { int other_function(int value){ qDebug() << value; return 0; } }Even with
-s EXPORTED_FUNCTIONS='["_other_function"]' -s EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]'and in the compiled YOURAPP.html
other_func = Module.cwrap("other_function", "number", ["number"]) other_func(1)There error still exist
Uncaught TypeErorr : Module.cwrap is not a functionAny help ? -
I prefer using the embind method.
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#embind
-
I prefer using the embind method.
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#embind