zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Build error #102

Open zengbo opened 2 months ago

zengbo commented 2 months ago

I follow the instruct:

in your build.zig's build function, add the following before b.installArtifact(exe):

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

exe.root_module.addImport("zap", zap.module("zap"));

Got the error:

error: ld.lld: undefined symbol: http_listen ld.lld: undefined symbol: fio_start

If add exe.linkLibrary(zap.artifact("facil.io")); again, It's OK

lhk commented 2 months ago

I have the same problem, but adding that extra line (either before or after exe.root_module.addImport...) doesn't fix the problem for me.

I'm using zig 0.12.0 installed with zigup. Cloning the zap repo and then executing zig build run works, so I think it's not about my zig version.

renerocksai commented 2 months ago

Please see instructions in the release notes. You need to add the following line as well:

    exe.linkLibrary(zap.artifact("facil.io"));

The README is based on the master version of zap which is a bit ahead. Recently, I merged a PR that makes the above line obsolete. Hence, it's not in the readme anymore.

I hope I can push out a new version soon so this issue won't persist for long.