Back to Wasmtime

Linking modules

docs/examples-linking.md

44.0.1950 B
Original Source

Linking modules

You can also browse this source code online and clone the wasmtime repository to run the example locally:

This example shows off how to compile and instantiate modules which link together. Be sure to read the API documentation for Linker as well.

Wasm: linking1.wat

wat
{{#include ../examples/linking1.wat}}

Wasm: linking2.wat

wat
{{#include ../examples/linking2.wat}}

Host Source

<!-- langtabs-start -->
rust
{{#include ../examples/linking.rs}}
c
{{#include ../examples/linking.c}}
cpp
{{#include ../examples/linking.cc}}
<!-- langtabs-end -->