#Zig Builder error

1 messages · Page 1 of 1 (latest)

empty salmon
#

Getting the error

error: root struct of file 'std' has no member named 'build'
const Builder = std.build.Builder;
                ~~~^~~~~~

When trying to run below with zig build

const std = @import("std");
const Builder = std.build.Builder;

pub fn build(b: *Builder) void {
    const mode = b.standardReleaseOptions(); // Use standardReleaseOptions for optimized release build

    // Add your custom build configurations here
    const exe = b.addExecutable("./main.zig");
    exe.setBuildMode(mode);
    exe.linkLibC();
    exe.addIncludeDir("/usr/lib/llvm-14/include");
    exe.addLibPath("/usr/lib/llvm-14/lib");
    exe.linkSystemLibrary("c++");
    exe.linkSystemLibrary("LLVM-14");

    const target = b.standardTargetOptions(.{});
    exe.setTarget(target);

    b.default_step.dependOn(&exe.step);
}

Version: 0.13.0-dev.46+3648d7df1

timber salmon
#

std.build.Builder hasn't existed since 0.11.0, half of this code won't work anymore

empty salmon
#

oh-

#

Let me update then

timber salmon
#

I recommend checking the release notes for 0.11 and 0.12