pluto
pluto copied to clipboard
how to resolve compilation errors when building on wsl2 Ubuntu-22.04
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.