To build C applications that use the Wasmer runtime as a host for guest Wasm modules, you will need a C compiler installed (clang or gcc, for example). Check the compiler installation instructions here.
Download our SDK for the C-API from Wasmer releases page.
Depending on your system, you will need to download:
Linux: wasmer-linux-amd64.tar.gz or wasmer-linux-aarch64.tar.gz
macOS: wasmer-darwin-amd64.tar.gz
Windows: wasmer-windows.tar.gz
Once you have downloaded the c-api file, you can now extract its contents and set the WASMER_C_API environment variable to the path of the wasmer-c-api directory (this will be very useful when running the examples):
# Extract the contents to a dirmkdirwasmertar-Cwasmer-zxvfwasmer-*.tar.gzexportWASMER_DIR=$(pwd)/wasmer# Update LD_LIBRARY_PATH to link against the libwasmer.so in the examplesexportLD_LIBRARY_PATH=$WASMER_DIR/lib/:$LD_LIBRARY_PATH