'How to supply embedded wasm code with WASI imports when embedding in C++ with wasmer's C/C++-API?

I've compiled a C++ file to wasm using emcc. The generated wasm code contains calls to imported WASI functions. When I then run the wasm module in the command line with wasmer's CLI tool like this: wasmer fromcpp.wasm it works without a problem, meaning wasmer supplies the WASI imports. How can I supply WASI imports when embedding the wasm code in C++ code using wasmer's C++ API (without implementing them myself)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source