re: Experimenting with Web Assembly and Node.js VIEW POST

VIEW FULL DISCUSSION
 

I also learned that if you're compiling C++ code with em++ instead of emcc, make sure to include extern "C" in front of any functions in your C++ code that you want to access from JavaScript. Otherwise, you'll get errors that the function can't be found (cause of C++'s complicated name mangling rules).

 

Is this why my exported functions are found in c but when I switch to cpp, my functions are undefined. I just refactored in rage for hours.

 

I bet that's it...if for no other reason because I was also refactoring in rage for some time too before I figured it out!

Oh man you are absolutely right, I am so happy! that is one of my many questions solved. seems like emscripten can only access C atleast with the similar code that you have. I'm trying to get Lua into node. Its proving ... challenging.

code of conduct - report abuse