与Go及Rust等现代语言一样,Zig内置了包管理器、构建系统及API、支持交叉编译和测试集成,这提高了Zig成为更好的C的机会,因为它解决了C(和C++)开发人员面临的关键系统编程问题。从语言设计的角度来看,Zig提供了C开发人员期望的现代语言的所有功能,因此C程序员可以逐步将他们的系统迁移到现代Zig,而无需重新编写他们遗留...
- GNU C - Apple Clang - 带有libc、BSD-libc和Microsoft C运行时的MSVC编译器 但是这两个组件对于现代系统编程需求来说还不够。程序员通常需要建立工具、包管理器和交叉编译工具等。 因此,在C生态系统中,像CMake、Ninja、Meson这样的构建工具以及类似Conan这样的包管理器逐渐流行,而像Go和Rust这样的现代语言...
Zig Version 0.10.0-dev.2674+d980c6a38 Steps to Reproduce > touch test.c > ~/zig-linux-x86_64-0.10.0-dev.2674+d980c6a38/zig cc -v -O0 -c test.c clang version 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 81f0e6c5b902ead84753490db4f0007...
if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/stage3" CACHE STRING set(CMAKE_INSTA...
$ cat a.c extern char __libc_single_threaded; int main(void) { return __libc_single_threaded; } $ clang a.c $ zig build-exe a.c -lc ld.lld: error: undefined symbol: __libc_single_threaded >>> referenced by a.c:3 >>> /home/vexu/.cache/zig/o/00d791557252b46f5ed6668a930...
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. - zig/cmake at master · ziglang/zig
//.char => return ZigTag.type.create(t.arena, "c_char"), // TODO: why is this different than clang translate-c? .char => return ZigTag.type.create(t.arena, "u8"), Member Vexu Feb 7, 2025 It's because of strings, char in C is usually signed while Zig string literals are...
edited Zig Version 0.13.0 Steps to Reproduce and Observed Behavior echo 'int main(){}' > test.c touch libtest.a ZIG_VERBOSE_LINK=1 zig cc -target x86_64-linux-gnu.2.19 -o test test.c -L. -Wl,--whole-archive -ltest -Wl,--no-whole-archive |& grep whole ...
The example given in the Documentation section Exporting C Libraries does not build (at least when I try). The required C headers file (mathtest.h) is not found. Need to add -femit-h to zig build-lib mathtest.zig -femit-h and or add the ...
This commit upgrades glibc shared library stub-creating code to use the new abilists file which is generated by the new glibc-abi-tool project: https://github.com/ziglang/glibc-abi-tool/ The abilists file is different in these ways: * It additionally encodes whether a symbol is a ...