You are not logged in.

#1 2025-12-03 05:31:58

c>rust
Member
Registered: 2025-09-07
Posts: 22

[SLOVE]ziglang 0.15.2 How to add dependency

I follow the instruction on https://zigzap.org/learn.html
adding this to
build.zig

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
        .openssl = false, // set to true to enable TLS support
    });
    _ = zap;

get error

/home/mq/.cache/zig/p/zap-0.8.0-AAAAAHquIwC7Et6QVdWF7gsZyMnaQa1JpmD12ovhNyx7/facil.io/build.zig:10:18: error: no field or m
ember function named 'addStaticLibrary' in 'Build'

cause b.addStaticLibrary don't exist
and b.addModule seem to be the way but i dont know how to use it
Wed Dec  3 01:21:40 PM +07 2025 edit:
I test with nix: samething

Last edited by c>rust (2025-12-06 06:01:49)

Offline

#2 2025-12-06 06:01:21

c>rust
Member
Registered: 2025-09-07
Posts: 22

Re: [SLOVE]ziglang 0.15.2 How to add dependency

i ask on https://discord.com/channels/6055718032 … 8670031873
and turn out

$ zig fetch --save "git+https://github.com/zigzap/zap#v0.9.0"#wrong
$ zig fetch --save "git+https://github.com/zigzap/zap" #fix but look up which version of zap support which version of zig

Last edited by c>rust (2025-12-06 10:23:46)

Offline

Board footer

Powered by FluxBB