Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #102

Open
zengbo opened this issue Apr 27, 2024 · 2 comments
Open

Build error #102

zengbo opened this issue Apr 27, 2024 · 2 comments

Comments

@zengbo
Copy link

zengbo commented Apr 27, 2024

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
Copy link

lhk commented Apr 27, 2024

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants