Skip to content

Commit bbf37a6

Browse files
authored
Add missing command in C plugin guide (WasmEdge#201)
* Update command Signed-off-by: Mahfuza Humayra Mohona <mhmohona@gmail.com> * Update command Signed-off-by: Mahfuza Humayra Mohona <mhmohona@gmail.com> --------- Signed-off-by: Mahfuza Humayra Mohona <mhmohona@gmail.com>
1 parent a34fc38 commit bbf37a6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/contribute/plugin/develop_plugin_c.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ To build the WasmEdge plug-in shared library, you have two options: build it dir
202202
203203
- **Build with Command**: if you choose to build the plug-in using the command line, run the following command in the terminal:
204204
205+
```bash
206+
gcc -std=c11 -DWASMEDGE_PLUGIN -shared -o libwasmedgePluginTest.so testplugin.c
207+
```
208+
205209
This command compiles the `testplugin.c` file into a shared library named `libwasmedgePluginTest.so`. The `-std=c11` flag sets the C language standard to C11, and the `-DWASMEDGE_PLUGIN` flag defines the WASMEDGE_PLUGIN macro, which can be used in your code.
206210

207211
- **Build with CMake**: If you prefer to use CMake to build the plug-in, create a `CMakeLists.txt` file in the root directory of your project and add the following content to the CMakeLists.txt file:

i18n/zh/docusaurus-plugin-content-docs/current/contribute/plugin/develop_plugin_c.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ To build the WasmEdge plug-in shared library, you have two options: build it dir
202202
203203
- **Build with Command**: if you choose to build the plug-in using the command line, run the following command in the terminal:
204204
205+
```bash
206+
gcc -std=c11 -DWASMEDGE_PLUGIN -shared -o libwasmedgePluginTest.so testplugin.c
207+
```
208+
205209
This command compiles the `testplugin.c` file into a shared library named `libwasmedgePluginTest.so`. The `-std=c11` flag sets the C language standard to C11, and the `-DWASMEDGE_PLUGIN` flag defines the WASMEDGE_PLUGIN macro, which can be used in your code.
206210

207211
- **Build with CMake**: If you prefer to use CMake to build the plug-in, create a `CMakeLists.txt` file in the root directory of your project and add the following content to the CMakeLists.txt file:

0 commit comments

Comments
 (0)