snippetbashTip
zig — The Zig compiler and toolchain. More information: <https://ziglang.org/documentation/master/>.
Viewed 0 times
thecommandandclitoolchaincompilerzig
Problem
How to use the
zig command: The Zig compiler and toolchain. More information: <https://ziglang.org/documentation/master/>.Solution
zig — The Zig compiler and toolchain. More information: <https://ziglang.org/documentation/master/>.Compile the project in the current directory:
zig buildCompile and run the project in the current directory:
zig build runInitialize a
zig build project with library and executable:zig initCreate and run a test build:
zig test {{path/to/file.zig}}Cross compile, build, and run a project for
x86_64 architecture and windows operating system:zig build run -fwine -Dtarget=x86_64-windowsReformat Zig source into canonical form:
zig fmt {{path/to/file.zig}}Translate a C file to
zig:zig translate-c -lc {{path/to/file.c}}Use Zig as a drop-in C++ compiler:
zig c++ {{path/to/file.cpp}}Code Snippets
Compile the project in the current directory
zig buildCompile and run the project in the current directory
zig build runInitialize a `zig build` project with library and executable
zig initCreate and run a test build
zig test {{path/to/file.zig}}Cross compile, build, and run a project for `x86_64` architecture and `windows` operating system
zig build run -fwine -Dtarget=x86_64-windowsContext
tldr-pages: common/zig
Revisions (0)
No revisions yet.