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.

1 Answer 1

-1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.