0

I have read another stackoverflow post here, which was using c instead of c++. I am using c++, but when I try to follow these procedures except instead of emcc i use em++ to build the wasm, it doesn't allow me to access the function. Suprisingly, when using a regular c file, it works. cm++

EDIT:

the command I am using to build the wasm file is

em++ -O2 test.cpp -o test.wasm -s WASM=1

EDIT 2:

I have discovered that emcc also works to build wasm from c++. I have used this command:

emcc -O2 test.cpp -o test.wasm -s WASM=1

but it still doesn't work.

Ank i zle
  • 2,089
  • 3
  • 14
  • 36

1 Answers1

0

In the post you are following, the function is add. If you replace result.instance.exports._add with result.instance.exports._Z3addii it will work.

Ank i zle
  • 2,089
  • 3
  • 14
  • 36