# Zig WebAssembly

**URL:** <https://ziggit.dev/t/zig-webassembly/2550>\
**Category:** Help\
**Tags:** wasm\
**Created:** [December 22, 2023, 5:27pm UTC](https://ziggit.dev/t/zig-webassembly/2550 "2023-12-22T17:27:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![castholm](https://ziggit.dev/user_avatar/ziggit.dev/castholm/32/1330_2.png) [@castholm](https://ziggit.dev/u/castholm)\
**Post date:** [December 22, 2023, 6:39pm UTC](https://ziggit.dev/t/zig-webassembly/2550/3 "2023-12-22T18:39:45Z")

</div>

> [@permutationlock](#):
>
> I believe that there was a [recent change](https://github.com/ziglang/zig/pull/17815) to now use `build-exe` with `-fno-entry` for `wasm` targets, not `build-lib` with `-dynamic`.

In addition to this, you need to explicitly state which `export`ed functions/variables you want to include in the Wasm output, either by passing `-rdynamic` to include everything, or by repeatedly passing the `--entry=<symbol>` for each symbol you want to include.

So the complete invocation is

```sh
zig build-exe ./math.zig -target wasm32-freestanding -fno-entry -rdynamic

```

---

_[View the full topic](https://ziggit.dev/t/zig-webassembly/2550)._
