the raylib dependency should be pinned because it specifies a hash and that hash has changed. i.e. I needed to change the line of build.zig.zon to:
.raylib = .{ .url = "https://github.com/raysan5/raylib/archive/refs/heads/master.tar.gz", .hash = "122028357fb37466a5c87f0b83f3a9ab8b9a762ffa91ca93caee324bad15033ab4f2" }, // <- hash is different than in the repo
Issue 2
I get this error when I try the zig build run step of the instructions:
src/main.zig:2:11: error: C import failed
const r = @cImport({
^~~~~~~~
src/main.zig:2:11: note: libc headers not available; compilation does not link against libc
referenced by:
main: src/main.zig:7:5
callMain: /snap/zig/11625/lib/std/start.zig:524:32
remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/extasia/.cache/zig/o/1081bdf0a8777e735014394697e1d4ec/cimport.h:1:10: error: 'raylib.h' file not found
#include <raylib.h>
This is fixed by adding the following line to build.zig
const lib = b.addStaticLibrary(.{
.name = "RayZig",
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
.link_libc = true, // <- this line!
});
Thanks for the repo.
Issue 1
the raylib dependency should be pinned because it specifies a hash and that hash has changed. i.e. I needed to change the line of build.zig.zon to:
.raylib = .{ .url = "https://github.com/raysan5/raylib/archive/refs/heads/master.tar.gz", .hash = "122028357fb37466a5c87f0b83f3a9ab8b9a762ffa91ca93caee324bad15033ab4f2" }, // <- hash is different than in the repo
Issue 2
I get this error when I try the
zig build run
step of the instructions:This is fixed by adding the following line to
build.zig
Cheers, Joe