Skip to content

It doesn't build on latest zig #39

@AntonC9018

Description

@AntonC9018

Trying to build a project using raylib with zig version

0.12.0-dev.3193+4ba4f94c9

Getting the following error.

As you can see the problem is that zig build now expects relative paths to c source files from the root build folder. So I've fixed that by changing the paths to be relative in build.zig of the raylib submodule.
Now I get a different error, about marshal.h not being found.

Then I realized the raylib submodule is just raylib, so I switched that to master. Now this is the error: https://pastebin.com/YZe4grhz
Which pushed me to try and regenerate the bindings. A file didn't compile because of FileSource missing.
I've fixed that too by writing a custom relative path function, just like in the other file:

const srcdir = struct {
    fn f() []const u8 {
        return std.fs.path.dirname(@src().file).?;
    }
}.f();

fn srcRelative(comptime path: []const u8) std.Build.LazyPath {
    return .{ .path = srcdir ++ path };
}

(but later found out it's been renamed to LazyPath).

Now I've tried to regenerate the bindings. zig build parse worked, zig build intermediate failed with UnexpectedToken.

At this point I think I'm getting way too deep. Maintainer, please fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions