Calling C++ function from JavaScript through Qt Webassembly
Unsolved
Qt for 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 function
Any help ?
-
I prefer using the embind method.
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#embind
-
@lorn-potter Thanks for the information. Yet <emscripten.h> cannot be found!