# Help

**URL:** https://ziggit.dev/c/help/6.md

[Latest](https://ziggit.dev/latest.md) · [Categories](https://ziggit.dev/categories.md) · [Tags](https://ziggit.dev/tags.md)

---

## [About the Help category](https://ziggit.dev/t/about-the-help-category/13)

<div class="topic-metadata">

**Author:** [@ziggit](https://ziggit.dev/u/ziggit)\
**Replies:** 0\
**Last updated:** [February 18, 2022, 2:03am UTC](https://ziggit.dev/t/about-the-help-category/13 "2022-02-18T02:03:55Z")

</div>

Post all your Zig related questions here and see how quickly another community member can help you find the answer.

---

## [Am I using Io.failing wrong?](https://ziggit.dev/t/am-i-using-io-failing-wrong/18091)

<div class="topic-metadata">

**Author:** [@truly-not-taken](https://ziggit.dev/u/truly-not-taken)\
**Replies:** 2\
**Last updated:** [October 25, 2026, 7:58am UTC](https://ziggit.dev/t/am-i-using-io-failing-wrong/18091 "2026-10-25T07:58:20Z")

</div>

This test spins in an infinite loop: test "failing Io fails to flush in positional mode" { var buffer: \[128\]u8 = undefined; var stdout: std.Io.File.Writer = .init(.stdout(), .failing, &buffer); try stdout.in…

---

## [Anyone unable to upgrade to 0.17.0 for some reason?](https://ziggit.dev/t/anyone-unable-to-upgrade-to-0-17-0-for-some-reason/17912)

<div class="topic-metadata">

**Author:** [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Replies:** 45\
**Last updated:** [October 25, 2026, 2:34am UTC](https://ziggit.dev/t/anyone-unable-to-upgrade-to-0-17-0-for-some-reason/17912 "2026-10-25T02:34:01Z")

</div>

Anyone who ran into regressions or other blockers when upgrading to 0.17.0, is your bug filed, and assigned to the 0.17.1 milestone? Anyone need help upgrading?

---

## [RadDebugger and Zig](https://ziggit.dev/t/raddebugger-and-zig/17826)

<div class="topic-metadata">

**Author:** [@igors84](https://ziggit.dev/u/igors84)\
**Replies:** 10\
**Last updated:** [October 25, 2026, 12:54am UTC](https://ziggit.dev/t/raddebugger-and-zig/17826 "2026-10-25T00:54:19Z")

</div>

Now that RadDebugger (alpha) is available for Linux I gave it a try on my Zig project. It is incredibly fast and smooth but I couldn’t find a way to make it usable with Zig types. I immediately went to see how will it ha…

---

## [How is the Zig Debugger now?](https://ziggit.dev/t/how-is-the-zig-debugger-now/18061)

<div class="topic-metadata">

**Author:** [@rickygai](https://ziggit.dev/u/rickygai)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 11:41pm UTC](https://ziggit.dev/t/how-is-the-zig-debugger-now/18061 "2026-10-24T23:41:51Z")

</div>

Windows 11 22H2 (OS Build 22621.6060) Visual Studio Code v1.143.1 Zig v0.18.0 I checked this forum regarding debugging articles, not much solutions found. Currently, I tested Zig with options: zig build-exe -fllvm -…

---

## [Getting Timezone aware time in WASM](https://ziggit.dev/t/getting-timezone-aware-time-in-wasm/18067)

<div class="topic-metadata">

**Author:** [@Plebosaur](https://ziggit.dev/u/Plebosaur)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 4:29pm UTC](https://ziggit.dev/t/getting-timezone-aware-time-in-wasm/18067 "2026-10-24T16:29:29Z")

</div>

Context is my Calorie tracker project that needs to compile to WASM. It’s only dependency is Sokol, which means that it uses libc and emscripten. For native targets I was able to use libc to get the timezone time (AFA…

---

## [Swapping variables?](https://ziggit.dev/t/swapping-variables/18081)

<div class="topic-metadata">

**Author:** [@SuXYIO](https://ziggit.dev/u/SuXYIO)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 4:10pm UTC](https://ziggit.dev/t/swapping-variables/18081 "2026-10-24T16:10:05Z")

</div>

Is there any syntax sugar for swapping variables in Zig? (e.g. a, b = b, a) I expected const std = @import("std"); pub fn main() void { var a: i32 = 42; var b: i32 = 69; std.debug.print("{}, {}\\n", .{ a, b…

---

## [Is zeroing user or lib responsibility](https://ziggit.dev/t/is-zeroing-user-or-lib-responsibility/18073)

<div class="topic-metadata">

**Author:** [@Vexo413](https://ziggit.dev/u/Vexo413)\
**Replies:** 2\
**Last updated:** [October 24, 2026, 2:41pm UTC](https://ziggit.dev/t/is-zeroing-user-or-lib-responsibility/18073 "2026-10-24T14:41:52Z")

</div>

I’m making a core password manager/vault library, and I’m wondering whether I should zero the memory or the user should do this. One way they could do this is through a ZeroingAllocator, which std.crypto.secureZero’s al…

---

## [Advice on examples project structure?](https://ziggit.dev/t/advice-on-examples-project-structure/18074)

<div class="topic-metadata">

**Author:** [@SuXYIO](https://ziggit.dev/u/SuXYIO)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 10:53am UTC](https://ziggit.dev/t/advice-on-examples-project-structure/18074 "2026-10-24T10:53:27Z")

</div>

Scenario I’m bulding a library, and includes examples. I already implemented a build.zig file that compiles examples with zig build examples. main part be like: const example\_step = b.step("examples", "Build all examp…

---

## [Is there a similar syntax for enum types?](https://ziggit.dev/t/is-there-a-similar-syntax-for-enum-types/6934)

<div class="topic-metadata">

**Author:** [@sdzx-1](https://ziggit.dev/u/sdzx-1)\
**Replies:** 3\
**Last updated:** [October 24, 2026, 3:49am UTC](https://ziggit.dev/t/is-there-a-similar-syntax-for-enum-types/6934 "2026-10-24T03:49:06Z")

</div>

The struct type can treat the entire file as a struct here. Is there a similar syntax for enum type?

---

## [Init(), create(), and ~~new()~~ make() (?)](https://ziggit.dev/t/init-create-and-new-make/14049)

<div class="topic-metadata">

**Author:** [@jmctagger](https://ziggit.dev/u/jmctagger)\
**Replies:** 43\
**Last updated:** [October 23, 2026, 10:30pm UTC](https://ziggit.dev/t/init-create-and-new-make/14049 "2026-10-23T22:30:44Z")

</div>

Can experienced zigsters confirm that this is the convention for structs in lib and app code? Provide init() function for callers to initialize a stack-allocated instance. Provide create(al: Allocator) function for cal…

---

## [Extern struct cannot hold vector since 0.17?](https://ziggit.dev/t/extern-struct-cannot-hold-vector-since-0-17/18063)

<div class="topic-metadata">

**Author:** [@nour](https://ziggit.dev/u/nour)\
**Replies:** 4\
**Last updated:** [October 23, 2026, 9:51pm UTC](https://ziggit.dev/t/extern-struct-cannot-hold-vector-since-0-17/18063 "2026-10-23T21:51:11Z")

</div>

Hello, I guess this is a 0.17 change? I error: extern structs cannot contain fields of type '@Vector(2, f32)' // I understand the following: note: vectors have no guaranteed in-memory representation // But I didn't see…

---

## [Get CWD path without \`realPath\`](https://ziggit.dev/t/get-cwd-path-without-realpath/16293)

<div class="topic-metadata">

**Author:** [@odeuce](https://ziggit.dev/u/odeuce)\
**Replies:** 9\
**Last updated:** [October 23, 2026, 2:49pm UTC](https://ziggit.dev/t/get-cwd-path-without-realpath/16293 "2026-10-23T14:49:19Z")

</div>

Getting started with Zig and trying to write a simple “print working directory” type of command. I’ve read the docs for std.Io.Dir and seen the realPath function and it’s siblings and the advice not to use it. Tried anyw…

---

## [Mutating generated files in later steps](https://ziggit.dev/t/mutating-generated-files-in-later-steps/18060)

<div class="topic-metadata">

**Author:** [@mba6comma1](https://ziggit.dev/u/mba6comma1)\
**Replies:** 2\
**Last updated:** [October 23, 2026, 10:17am UTC](https://ziggit.dev/t/mutating-generated-files-in-later-steps/18060 "2026-10-23T10:17:50Z")

</div>

The gist of what I’m trying to do is: I’m making an ISO file by calling an external command, and then I’m trying to modify that ISO file by calling another command that isn’t actually external but for the purposes of thi…

---

## [Identify unnecessary float/int conversions?](https://ziggit.dev/t/identify-unnecessary-float-int-conversions/18056)

<div class="topic-metadata">

**Author:** [@nairou](https://ziggit.dev/u/nairou)\
**Replies:** 2\
**Last updated:** [October 22, 2026, 7:15pm UTC](https://ziggit.dev/t/identify-unnecessary-float-int-conversions/18056 "2026-10-22T19:15:22Z")

</div>

I’ve been using 0.15 for my current project, but I’m considering upgrading to 0.17. One thing I remember reading in the 0.16 release notes was that some of the rules regarding float/int coercion were relaxed. Currently m…

---

## [Initializing arguments to @call during comptime](https://ziggit.dev/t/initializing-arguments-to-call-during-comptime/18058)

<div class="topic-metadata">

**Author:** [@kapusta](https://ziggit.dev/u/kapusta)\
**Replies:** 1\
**Last updated:** [October 22, 2026, 6:26pm UTC](https://ziggit.dev/t/initializing-arguments-to-call-during-comptime/18058 "2026-10-22T18:26:11Z")

</div>

HELLO, I want to write down some comptime wrapper for zig functions to be converted into lua CFunctions, but Im stuck with constructing argument object for @call. For now i try to do something like: const info = @type…

---

## [I've painted myself into a corner with comptime and I'm seeking advice](https://ziggit.dev/t/ive-painted-myself-into-a-corner-with-comptime-and-im-seeking-advice/18012)

<div class="topic-metadata">

**Author:** [@grurbo](https://ziggit.dev/u/grurbo)\
**Replies:** 13\
**Last updated:** [October 22, 2026, 4:40pm UTC](https://ziggit.dev/t/ive-painted-myself-into-a-corner-with-comptime-and-im-seeking-advice/18012 "2026-10-22T16:40:57Z")

</div>

I didn’t know it was possible to create a comptime program that was so large it would no longer compile. I kept raising @setEvalBranchQuota to fix it, but now, by passing maxInt(u32), the compiler just segfaults. I have …

---

## [\[RESOLVED\] About syntax color themes](https://ziggit.dev/t/resolved-about-syntax-color-themes/18052)

<div class="topic-metadata">

**Author:** [@rickygai](https://ziggit.dev/u/rickygai)\
**Replies:** 2\
**Last updated:** [October 22, 2026, 1:07am UTC](https://ziggit.dev/t/resolved-about-syntax-color-themes/18052 "2026-10-22T01:07:19Z")

</div>

Windows 11 22H2 (OS Build 22621.6060) Visual Studio Code v1.143.0 Zig Language extension v0.6.19 Zig Language 0.18.0 (currently using) hello, New user here and thanks for creating such a great tool. I am fine with …

---

## [Help with audio plugins](https://ziggit.dev/t/help-with-audio-plugins/17992)

<div class="topic-metadata">

**Author:** [@csanri](https://ziggit.dev/u/csanri)\
**Replies:** 10\
**Last updated:** [October 21, 2026, 5:04pm UTC](https://ziggit.dev/t/help-with-audio-plugins/17992 "2026-10-21T17:04:32Z")

</div>

Hello everyone, I’m new to Zig and I’m enjoying it a lot. I’ve been coding for a while, but I’ve done mostly Data Science related stuff, and a little bit of C in the past, and also I’ve been making electronic music for …

---

## [What is this type \`\[\*c\]VkPhysicalDevice\`?](https://ziggit.dev/t/what-is-this-type-c-vkphysicaldevice/18044)

<div class="topic-metadata">

**Author:** [@TrashBandit](https://ziggit.dev/u/TrashBandit)\
**Replies:** 2\
**Last updated:** [October 21, 2026, 6:26am UTC](https://ziggit.dev/t/what-is-this-type-c-vkphysicaldevice/18044 "2026-10-21T06:26:50Z")

</div>

I’m not having luck searching for this, though there’s a good chance it was in ziglings and I’ve simply forgotten. I’m using Vulkan as a system library and pulling it in via translate\_c with Zig 0.17.0. It produced this…

---

## [Zig or Raylib issue?](https://ziggit.dev/t/zig-or-raylib-issue/18032)

<div class="topic-metadata">

**Author:** [@OffsetMagnet](https://ziggit.dev/u/OffsetMagnet)\
**Replies:** 6\
**Last updated:** [October 21, 2026, 3:10am UTC](https://ziggit.dev/t/zig-or-raylib-issue/18032 "2026-10-21T03:10:30Z")

</div>

Just started learning Zig! I was messing around with Raylib in version 0.16. Just upgraded to version 0.17 and started a new project. I fetched this commit hash of Raylib for my build.zig.zon file: GitHub - raylib-zig/ra…

---

## [Pinning a local variable to a machine register](https://ziggit.dev/t/pinning-a-local-variable-to-a-machine-register/18041)

<div class="topic-metadata">

**Author:** [@tenderlove](https://ziggit.dev/u/tenderlove)\
**Replies:** 6\
**Last updated:** [October 20, 2026, 8:05pm UTC](https://ziggit.dev/t/pinning-a-local-variable-to-a-machine-register/18041 "2026-10-20T20:05:35Z")

</div>

Hi, I’m building a bytecode interpreter hosted in Zig, and I’d like to build a profiler for the guest language. My profiler works by sending a signal on an interval, getting the current PC, and then walking up the stac…

---

## [Looping on \[\]MyType backed by \[\]MySuperType](https://ziggit.dev/t/looping-on-mytype-backed-by-mysupertype/18023)

<div class="topic-metadata">

**Author:** [@nour](https://ziggit.dev/u/nour)\
**Replies:** 7\
**Last updated:** [October 20, 2026, 1:35pm UTC](https://ziggit.dev/t/looping-on-mytype-backed-by-mysupertype/18023 "2026-10-20T13:35:45Z")

</div>

Hello, In a painting software defining TabletPoint which contains .position (a vector field). I have \[\]TabletPoint. I have a transform library which acts on vectors and doesn’t bother with TabletPoint. It’s not couple…

---

## [Glib-Critial error when compiling with exe.root\_module.linkSystemLibrary in build.zig](https://ziggit.dev/t/glib-critial-error-when-compiling-with-exe-root-module-linksystemlibrary-in-build-zig/18034)

<div class="topic-metadata">

**Author:** [@TrashBandit](https://ziggit.dev/u/TrashBandit)\
**Replies:** 1\
**Last updated:** [October 20, 2026, 6:52am UTC](https://ziggit.dev/t/glib-critial-error-when-compiling-with-exe-root-module-linksystemlibrary-in-build-zig/18034 "2026-10-20T06:52:49Z")

</div>

Hi! I’m a bit lost with this compilation error. I have added the following to my build.zig file: const sdl = b.dependency("sdl", .{ .optimize = optimize, .target = target, }); exe.root\_modul…

---

## [Annoymous struct](https://ziggit.dev/t/annoymous-struct/18031)

<div class="topic-metadata">

**Author:** [@Koop](https://ziggit.dev/u/Koop)\
**Replies:** 9\
**Last updated:** [October 20, 2026, 6:52am UTC](https://ziggit.dev/t/annoymous-struct/18031 "2026-10-20T06:52:09Z")

</div>

What is an anonymous struct used for? For example in std.debug.print a required argument is an anonymous struct but how does it relate?

---

## [Simplest way to display a usable window in Wayland/X11 and Win32?](https://ziggit.dev/t/simplest-way-to-display-a-usable-window-in-wayland-x11-and-win32/18025)

<div class="topic-metadata">

**Author:** [@blocky\_studio](https://ziggit.dev/u/blocky_studio)\
**Replies:** 6\
**Last updated:** [October 19, 2026, 5:39pm UTC](https://ziggit.dev/t/simplest-way-to-display-a-usable-window-in-wayland-x11-and-win32/18025 "2026-10-19T17:39:49Z")

</div>

I’m looking for the simplest, lowest-cost program to display a window in Win32 and X11 without requiring any dependencies. I got a basic Win32 window working, executable size is 6KB, but it is far from perfect and probab…

---

## [Panic on attempting to access union payload](https://ziggit.dev/t/panic-on-attempting-to-access-union-payload/18027)

<div class="topic-metadata">

**Author:** [@aurelivia](https://ziggit.dev/u/aurelivia)\
**Replies:** 5\
**Last updated:** [October 19, 2026, 1:58pm UTC](https://ziggit.dev/t/panic-on-attempting-to-access-union-payload/18027 "2026-10-19T13:58:50Z")

</div>

Hello, I’m currently losing my mind. I’m attempting to use this lovely windowing library, following these instructions to access the wayland API. However, any attempt to access the .backend union with any value results …

---

## [New to Zig, and systems programming. What am I doing wrong here?](https://ziggit.dev/t/new-to-zig-and-systems-programming-what-am-i-doing-wrong-here/17971)

<div class="topic-metadata">

**Author:** [@willp223](https://ziggit.dev/u/willp223)\
**Replies:** 25\
**Last updated:** [October 19, 2026, 6:32am UTC](https://ziggit.dev/t/new-to-zig-and-systems-programming-what-am-i-doing-wrong-here/17971 "2026-10-19T06:32:26Z")

</div>

Hey Everyone, I am an “AI” Engineer (AI tooling). Most of my experience is in Python, and Typescript. Looking to escape web dev hell so I am learning zig! I have done all of this without AI pretty much which is a pretty…

---

## [Zig doesn't generate debug info](https://ziggit.dev/t/zig-doesnt-generate-debug-info/18016)

<div class="topic-metadata">

**Author:** [@Karim.MK](https://ziggit.dev/u/Karim.MK)\
**Replies:** 10\
**Last updated:** [October 19, 2026, 5:24am UTC](https://ziggit.dev/t/zig-doesnt-generate-debug-info/18016 "2026-10-19T05:24:35Z")

</div>

Hi. I recently started using The RAD Debugger, and overall it’s been a good experience on Linux. However, in zig it usually doesn’t work great mainly because zig doesn’t generate the full debug info for the program. Fo…

---

## [Why does std.Io.Dir.realPathFileAlloc return sentinel-terminated slice since 0.16?](https://ziggit.dev/t/why-does-std-io-dir-realpathfilealloc-return-sentinel-terminated-slice-since-0-16/17934)

<div class="topic-metadata">

**Author:** [@zigo](https://ziggit.dev/u/zigo)\
**Replies:** 10\
**Last updated:** [October 19, 2026, 3:45am UTC](https://ziggit.dev/t/why-does-std-io-dir-realpathfilealloc-return-sentinel-terminated-slice-since-0-16/17934 "2026-10-19T03:45:08Z")

</div>

The corresponding std.fs.Dir.realpathAlloc in 0.15 returns non-sentinel-terminated slice. The change makes the following code panic: const std = @import("std"); pub fn main(init: std.process.Init) !void { const nu…

[Next page](https://ziggit.dev/c/help/6.md?page=1)
