C/C++

To execute Function tasks, you may need to perform additional steps before creating them. Please refer to the following instructions to create a Function task in C/C++.

Task Preparation

Source Code Structure

In order to compile your source code, make sure you have the following file structure within the ❮sourceCodePath❯ folder that will be built.

📁 src └─ 📄 main.c 📄 compile.sh

Compile

You will need to create a compile.sh file to build your code and place all the required libraries your project needs.

Compile.sh example

#!/bin/sh
${WASI_SDK_PATH}/bin/clang --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot src/main.c -g -o task.wasm "-Wl,--stack-first,-zstack-size=1048576"

Last updated

Was this helpful?