Setup your C/C++ environment
Last updated
Was this helpful?
Last updated
Was this helpful?
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 .
Starting with Wasmer 1.0 all the releases ship with the required libraries and headers to use Wasmer from C and C++.
If you haven't yet, let's install Wasmer:
Once Wasmer is installed, you can get the pkg-config
easily:
Linux: wasmer-linux-amd64.tar.gz
or wasmer-linux-aarch64.tar.gz
macOS: wasmer-darwin-amd64.tar.gz
or wasmer-darwin-arm64.tar.gz
Windows: wasmer-windows.tar.gz
Once you have downloaded the framework, you can now extract its contents and set the WASMER_DIR
environment variable to the path of the wasmer directory (this will be very useful when running the examples):
First, you can test if clang
or gcc
is installed already by running:
If this command does not return the version, then see the following:
To install gcc on a Debian based, you will want to run the following:
Gcc should be installable on your favorite linux distro as well. Please search for the correct command for your desired distribution.
If these commands work, The compiler and the Wasmer C API are successfully installed!
Next, let's take a look at some examples!
Download Wasmer from . Depending on your system, you will need to download:
Note: You can also .
gcc
/ clang
is usually installed by default. However, if it is not, you can on your mac.
To install gcc on Windows, you will probably want to install a GNU environment on windows. We suggest using .