Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
459 stars 101 forks source link

Error building with an existing project from example in README #102

Closed 9D-Tony closed 1 month ago

9D-Tony commented 1 month ago

When following the example in the readme on Windows with zig 12.0.0 I had to add a "version", "name" and "paths" tag above the depenecies in the build.zig.zon file like so:

.{
    // ...
    .name = "zig-raylib",
    .version = "1.0.0",
    .paths = .{ "build.zig", "build.zig.zon", "emcc.zig", "lib/raylib.zig", "lib/raylib-ext.zig", "lib/raymath.zig", "lib/raymath-ext.zig", "lib/rlgl.zig", "lib/rlgl-ext.zig", "lib/raygui.zig", "lib/raygui-ext.zig" },
    .dependencies = .{
        .@"raylib-zig" = .{
            .url = "https://github.com/Not-Nik/raylib-zig/archive/devel.tar.gz",
            .hash = "12000000000000000000000000000000000000000000000000000000000000000000", // put the actual hash here
        },
    },
    // ...
}

Adding this into the readme for users would help people that are new to the zig build system.

Not-Nik commented 1 month ago

That is not what your build.zig.zon should look like. Your paths should contain your own source files, not raylib-zig's. If you don't know how to setup a build script you should use the provided project_setup.sh (on Windows either use Git Bash or copy the build script from the project_setup.sh source).