-
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
build.zig.zon file:
...
.sdl = .{
.url = "https://github.com/MasterQ32/SDL.zig/archive/dd46ee3.tar.gz",
.hash = "12202a0847d24f9c79302fff04e73d65a3342baecf0dfea46ac304eb68109ab6b472",
}
...build.zig file:
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "example",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const zgl = b.dependency("zgl", .{});
exe.addModule("zgl", zgl.module("zgl"));
const sdl = b.dependency("sdl", .{});
exe.addModule("sdl", sdl.module("sdl"));
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
const unit_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const run_unit_tests = b.addRunArtifact(unit_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_unit_tests.step);
}I get this error:
hasan@asus:example$ zig build
thread 94179 panic: unable to find module 'sdl'
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/debug.zig:373:22: 0x3a18a9 in panicExtra__anon_47103 (build)
std.builtin.panic(msg, trace, ret_addr);
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/debug.zig:348:15: 0x3787a9 in panic__anon_28777 (build)
panicExtra(null, null, format, args);
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/Build.zig:1707:18: 0x34e347 in module (build)
panic("unable to find module '{s}'", .{name});
^
/home/hasan/coding/zig/opengl/example/build.zig:19:36: 0x30b0f9 in build (build)
exe.addModule("sdl", sdl.module("sdl"));
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/Build.zig:1843:33: 0x2f9cb3 in runBuild__anon_7150 (build)
.Void => build_zig.build(b),
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/build_runner.zig:298:29: 0x2f58ee in main (build)
try builder.runBuild(root);
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/start.zig:370:37: 0x2e1325 in posixCallMainAndExit (build)
var i: usize = 0;
^
/home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/lib/std/start.zig:243:5: 0x2e0e11 in _start (build)
asm volatile (switch (native_arch) {
^
???:?:?: 0x4 in ??? (???)
Unwind information for `???:0x4` was not available, trace may be incomplete
error: the following build command crashed:
/home/hasan/coding/zig/opengl/example/zig-cache/o/a5d18aabd80fe14db47c9868cb3b387f/build /home/hasan/opt/zig/zig-linux-x86_64-0.12.0-dev.396+55f0d8b41/zig /home/hasan/coding/zig/opengl/example /home/hasan/coding/zig/opengl/example/zig-cache /home/hasan/.cache/zigJerwuQu
Metadata
Metadata
Assignees
Labels
No labels