Specify output directory and binary name to zig build-exe
I struggle to find any equivalent of C compiler’s cc <srcs> -o <path/and/binary/name>
in documentation of zig build-exe
. Only thing that I found is option --name
, but It cannot specify path, only name of unit.
Is there any way to do so in command, or using build.zig file is the only way?
Why are const pointers different to var pointers in Zig
I have the following in Zig
How to run shell commands which require input in zig?
I want to run some shell commands in zig which asks for input. For example look at my code, I want to update packages, but that requires sudo password which I obviously cant enter. Im also ok, to just run .sh file with zig, but I want to see progress and obviously be able to input password or smth else if needed. Is there some better way to do this?
How to `fn UInt(bit_size) type` where UInt(24) returns u24? is this possible?
To my understanding, Zig supports types u1..u65535.
Cast nested arrays to nested slices
I am struggling to cast a nested array, say of type [5][5]u8
, to the corresponding nested slice type like [][]u8
.
is there a way to write stub functions in zig?
Just like how Rust offers todo!()
or how Ocaml has let func = "Failure "Unimplemented""
is there a way to write a function in zig that doesn’t have the body implemented and doesn’t raise any warnings and errors after being compiled?
Is it possible to override std_options when targeting WASM?
I’d like to declare my own std_options
when targeting WASM so that I can provide a logging implementation that prints to the browser’s console window. I have a wasm_root.zig
module that does just that, however, it’s not working. I suspect it’s because of how wasm binaries are compiled. In my case:
Is there a way to do scoped type variables in zig for a generic struct?
I’m pulling from Haskell to look into this question, but allow me to expose the zig example first.
Wrong expected type using GeneralPurposeAllocator#allocator
I have a function
Wrong expected type using GeneralPurposAllocator#allocator
I have a function