Closed kalwalt closed 3 years ago
Ohhh, I see. Thanks for pointing this out, feel free to make a PR for this!
@EdwardLu2018 Does it works? Without adding -s EXPORTED_FUNCTIONS='['_malloc', '_free', '_initAR', '_track', '_resetTracking']'
?
It should, because I had EMSCRIPTEN_KEEPALIVE
before each of those exported function definitions. I believe it still works
It should, because I had
EMSCRIPTEN_KEEPALIVE
before each of those exported function definitions. I believe it still works
Ok i will test your changes :smiley:
You are right, It's not necessary. we can close this.
I have encounter the problem after compiled. Any Comments?
I have encounter the problem after compiled. Any Comments?
It could depends by which emcc version are you used to build the libs, I have used emcc 2.0.20 version, consider that previous version may have slightly differences. Have you also run the npm run build
command?
Maybe try cleaning your build folder or your browser cache? @kalwalt Does the latest version work for you?
Maybe try cleaning your build folder or your browser cache? @kalwalt Does the latest version work for you?
@EdwardLu2018 I will check again when i have time. :smile:
Sorry. My bad. I just got some files changed and didn't notice that. It's working. Pls close it. Thx.
The functions initAR, track and resetTracking are invoked with an Emscripten
cwrap
function with mangled names for example initAR is invoked with https://github.com/EdwardLu2018/wasm-ar/blob/76b749b48c8170fda9d2de3c1f85d98b40c46a98/js/image-tracker.js#L22 note"_Z6initARPhmm"
that happens because the three functions are not wrapped inside ato prevent C++ name mangling as described in https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html?highlight=cwrap#calling-compiled-c-functions-from-javascript-using-ccall-cwrap and add those function to the
-s EXPORTED_FUNCTIONS='['_malloc', '_free', '_initAR', '_track', '_resetTracking']'
@EdwardLu2018 I would submit a PR if you agree.