Skip to content

how to resolve compilation errors when building on wsl2 Ubuntu-22.04 #336

Description

@csmyx

Hi, I m a zig noob. I‘m trying to build this on wsl2 Ubuntu-22.04,but when I build with zig-0.9.1 on tag v0.2, I got whese compile errors:

❯ zig version
0.9.1
❯ zig build
/home/hugo/zig_repos/pluto/build.zig:88:11: error: unused local constant
    const build_mode_str = switch (build_mode) {
             ^
❯ zig build
./build.zig:56:9: error: no member named 'addBuildOption' in struct 'std.build.LibExeObjStep'
    exec.addBuildOption(TestMode, "test_mode", test_mode); 

For the first error, I just add a line "_ = build_mode_str;" to depress the const restriction. but I don't known why is this happening.

As for the second error, I don't know how to fix it and Why is this happening?It seems to be related to zig lib api updates, but I'm clearly using the correct version zig 0.9.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions