Open xyproto opened 6 years ago
My plan is to add a zig example to this collection of SDL2 examples, if I can get it to work.
When building with zig 0.4.0+e553ade0
I get:
/sdl-zig-demo/build.zig:15:22: error: no member named 'addCommand' in struct 'std.build.Builder'
const run_cmd = b.addCommand(".", b.env_map,
^
I tried this again with the latest version of zig (0.4.0+50c8a93a) and the latest commit from this repository. This is the result:
% zig build
/home/afr/clones/sdl-zig-demo/build.zig:15:22: error: no member named 'addCommand' in struct 'std.build.Builder'
const run_cmd = b.addCommand(".", b.env_map,
^
/home/afr/clones/sdl-zig-demo/build.zig:16:21: error: expected array type or [_], found slice
[][]const u8{exe.getOutputPath(), });
^
I run zig build run
as per the README.md
and get the same error:
sdl-zig-demo/build.zig:15:22: error: no member named 'addCommand' in struct 'std.build.Builder'
const run_cmd = b.addCommand(".", b.env_map,
^
Using zig version 0.5.0
I can successfully build with command zig build
if I comment out the last 5 lines in the build.zig
file:
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("sdl-zig-demo", "src/main.zig");
exe.setBuildMode(mode);
exe.linkSystemLibrary("SDL2");
exe.linkSystemLibrary("c");
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
// const run = b.step("run", "Run the demo");
// const run_cmd = b.addCommand(".", b.env_map,
// [][]const u8{exe.getOutputPath(), });
// run.dependOn(&run_cmd.step);
// run_cmd.step.dependOn(&exe.step);
}
I run the program with ./zig-cache/bin/sdl-zig-demo
and get the expected result: the zig.bmp
image drawn in a window.
same issue. On zig 0.5.0
C:\Users\risharan\DevSpace\Zig\sdl-zig-demo-master\build.zig:15:22: error: no member named 'addCommand' in struct 'std.build.Builder'
const run_cmd = b.addCommand(".", b.env_map,
^
Still an issue with zig version 0.5.0+9439bf380
.
When checking out this repository and building with
zig build
I get the following:sdl2 version 2.0.9 is installed.
I have no idea what
wbnoinvdintrin.h
is, I've never seen it before.